My program opens nicely with a Windows 7 shortcut. I want that in a batch file. Contents of shortcut [full path] copied into *.bat opens program minus needed hidden parameters.

I tried preceding with "CD" and "CD /d" to folder, but no folder change. Manually changing to program folder, and copy of *.bat, then program works.

The CD does work in a command-prompt box.

Your posts about "CD /D %~dp0" don't teach me enough.

link|improve this question
Does the path name contain spaces, and if so, are you surrounding it in quotes? – Majenko Apr 23 '11 at 17:39
feedback

1 Answer

Well, try that:

cd %programfiles%

Or:

cd "c:\program files (x86)"

Or:

cd "c:\program files"

Remember that if you are running from a different drive, you must change it in the batch, simply writing that before or after cd command:

c:
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.