up vote 2 down vote favorite
1
share [g+] share [fb]

How can I add command line options to an executable in a shortcut in Windows XP?

For example in the shortcut properties in target I have:

"c:\path\to\exe\pogram.exe"

I want to add some options:

"c:\path\to\exe\program.exe -option1 -option2"

However when I do this I get an error saying that the name specified in the target box is not valid.

link|improve this question
feedback

3 Answers

up vote 7 down vote accepted

Have you tried

"c:\path\to\exe\program.exe" -option1 -option2

Only the program name and path needs to be inverted.

link|improve this answer
Works, thanks! That is the power of superuser.com. Its faster than trying to google an answer. – Karl Voigtland Aug 25 '09 at 17:39
feedback

Your quotes are in the wrong place. The quotes only go around individual paths. So move your ending quote back to the end of program.exe and leave -option1 -option2 outside of the quotes.

link|improve this answer
feedback

Place the switches after the quotes.

Only the program path is kept in quotes due to spaces in the path. Something like My Documents will not resolve properly due to the space between the words, so quotes are needed. This is also why you probably won't find a program with multi-word switches (that are seperate) such as --example switch. You will usually see something like --example-switch instead because a space constitutes a separate program argument.

link|improve this answer
Can't believe I got an answer in before you – Diago Aug 25 '09 at 17:41
I was answering a second question when my program went off, this one seemed easier but I was too late :( – John T Aug 25 '09 at 18:02
feedback

Your Answer

 
or
required, but never shown

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