Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

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:
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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