I have this simple batch script. Lets call it 'Hello World.bat':
echo "Hello World!"
In a command line, running
cmd /c start "C:\path\to\Hello World.bat"
causes the a new command line window to show up, but the code in the .bat file is not executed.
I can rename this bat file to Hello_World.bat, remove the quotes from the command line command, and it works fine. However, with the quotes (which are necessary due to the spaces), it will not work.
Any suggestions? The application I'm working on calls customer-placed batch files, so unfortunately just renaming it isn't an option.
Answer
The Start command actually requires you to put in a title parameter like this:
start [""] [/d ]
You can get around this by adding an empty " " before the path to your file, like this:
cmd start "" /c "C:\path\to\Hello World.bat"
No comments:
Post a Comment