Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|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

Well, try that:

cd %programfiles%


cd "c:\program files (x86)"


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:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .