Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change directory for DOS window
I have a DOS program that must be run from its directory
and will not accept paths. It is launched by a DOS batch file. The batch file and the DOS program are in the same directory. The batch file can be run with a path to the required directory. When I run the batch file from a macro with the correct path, the DOS file will not run because the default directory is the root directory. I would like to write a macro that will change the DOS directory to the correct directory then run the batch file. I can't do a directory change in the batch file because some of the files for the DOS program have been pre-set to look for files in a directory designated by the batch file. Currently I can run the batch file from the macro, I can run command.com to open a DOS window, but I can't change the DOS directory THEN run the batch file. Any help would be appreciated. TIA, Garry |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change directory for DOS window
"Garry" wrote in message ... I have a DOS program that must be run from its directory and will not accept paths. It is launched by a DOS batch file. The batch file and the DOS program are in the same directory. The batch file can be run with a path to the required directory. When I run the batch file from a macro with the correct path, the DOS file will not run because the default directory is the root directory. I would like to write a macro that will change the DOS directory to the correct directory then run the batch file. I can't do a directory change in the batch file because some of the files for the DOS program have been pre-set to look for files in a directory designated by the batch file. Currently I can run the batch file from the macro, I can run command.com to open a DOS window, but I can't change the DOS directory THEN run the batch file. Any help would be appreciated. TIA, Garry Set the path variable in the batch file, the system looks in directories specified in path when you attempt to execute a program example @echo off set origpath=%path% path d:\pcw;%path% ed %1 %2 set path=%origpath% set origpath= This saves the existing path, adds the directory of interest to the beginning of the path, invokes the editor, and on termination of the editor, restores the path to what it was before and deletes the temporary variable used to hold the original path.directories. Keith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change directory to list default | Excel Discussion (Misc queries) | |||
Change directory | Excel Discussion (Misc queries) | |||
How can I change list into a directory format? | Excel Worksheet Functions | |||
Takes too long for Filedialog to change directory | Excel Discussion (Misc queries) | |||
change directory for refresh data | Excel Discussion (Misc queries) |