Tech Support Guy banner
Status
Not open for further replies.
1 - 5 of 5 Posts

·
Registered
Joined
·
2 Posts
Discussion Starter · #1 ·
Hello all. I am trying to write a very simple batch file that launches a program. I am very much a novice at this but I'm able to piece things together from information online.

My script so far is simple:

Code:
@echo off

start "C:\Program Files\blah directory\blah.exe"
Now here's where it gets tricky. The program in question is designed to run only when the CD is in the drive. I made an .iso copy of the CD and mounted the iso using Virtual CloneDrive. No problems there. When I double-click on blah.exe from Windows Explorer, the program launches just fine. BUT, when I run my batch file, it complains about the CD not being in the drive.

Shouldn't they be doing the exact same thing? Why does clicking to run the program work, while the batch file fail? Is there something I can do with environment variables that might help?
 

·
Registered
Joined
·
21,334 Posts
Maybe the batch is not running because of the security context. I am not sure batch files run by default in WIndows 7 without running as admin.
 

·
Registered
Joined
·
2 Posts
Discussion Starter · #5 ·
I found that if I used a slightly different syntax, it worked just fine:

Code:
start /d "C:\Program Files\blah directory\" blah.exe
I guess maybe it needed to be inside the directory before trying to run the exe?

Thanks everyone who tried to help.
 
1 - 5 of 5 Posts
Status
Not open for further replies.
Top