Reputation: 400
I am having a problem starting a .exe file with a batch file.
The program is called "ck.exe" and exists in the E:\ drive as part of the DVD-RW for the PC game "Myst III Exile"
Myst III Cover Art if you want to see
I want to do this because the game does not have a nice built in way to run the program from the desktop
The folder looks like:
Computer >
DVD RW Drive (E:) Exile DVD >
...
ck.exe
...
Here is my code:
@echo off
REM a batch file that starts Exile or tells you if the disc is in
IF EXIST E: GOTO Start
PAUSE>nul
:Start
CD \
ECHO found the front drive
CD E:
ECHO found E: drive
E:\ck.exe
ECHO began program
PAUSE>nul
EXIT
My OS is Windows 7 and cmd.exe is running with administrator privileges
NOTE: This program does not return an error, however the command prompt displays:
found the front drive
E:\
found E: drive
began program
Upvotes: 2
Views: 2365
Reputation: 1559
If you want to make a directory on e:\ the current directory, change the current drive as well as the directory:
cd /d E:\
Only cd E:
is not enough for that.
Upvotes: 6