Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a batch file from VB
I am trying to execute a batch file from visual basic.
While the VB help suggests ways to execute DLL or enable OLE objects, these are well beyond my skill area. I can't find anything specific in help to allow me to run a batch file automatically. When running the program manually, I open a command prompt window and run the batch file from there. I would like to automate this from Excel. Thx in advance, GC p.s. How do you search the newsgroup aside from scrolling through the postings? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a batch file from VB
Hi
Use something like this to select the drive and dir you want. ChDrive "D" ' be sure you are logged on to the drive you want, in this case drive "D" ChDir "\my music" ' change to the dir you want to be in, starting first at the root dir (the \) MsgBox CurDir ' show me where I am To close the dos window after the batch file ends, I assume you are using win 98 since win xp seems to do this as the default. After running the batch file, with the dos window open, right click on the dos window title bar. Select properties. On one of the tabs(I forget which one and am not on a win 98 system) you will see a checkbox with the caption " Close on Exit". Check the checkbox. Click apply. Click OK. Now it should close automatically after it finishes running. HTH Ken M "Graham Carter" wrote in message ... I am trying to execute a batch file from visual basic. While the VB help suggests ways to execute DLL or enable OLE objects, these are well beyond my skill area. I can't find anything specific in help to allow me to run a batch file automatically. When running the program manually, I open a command prompt window and run the batch file from there. I would like to automate this from Excel. Thx in advance, GC p.s. How do you search the newsgroup aside from scrolling through the postings? --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
batch file | Excel Discussion (Misc queries) | |||
Would Like to Automate Batch File Creation and Text FIle Import | Excel Discussion (Misc queries) | |||
Hide Excel session when running at the batch mode | Excel Discussion (Misc queries) | |||
Run a Batch file with variables | Excel Discussion (Misc queries) | |||
Running a batch file from Excel VBA | Excel Programming |