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.

I would like to create shortcuts to some executable files (exe, bat, com...) on Windows 7 using bat files, but I had some troubles with that:

  1. start notepad.exeworks perfectly, but start Foxit Reader.exe or start "Foxit Reader.exe" will not function. How to use start command with files named with space characters?

  2. call notepad.exe or start "Foxit Reader.exe" or just notepad.exe or "Foxit Reader.exe" works but a command prompt is opened and remains opened until the user close it or called executable. Any way to avoid it?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Read help for start carefully. And start does not wait for started process termination by default (there is /wait flag for "waiting" mode).

start "" "Foxit Reader.exe"
share|improve this answer
    
Oh my! If I could put that question eligible for bounty today, I would assign 50 points to you :) –  kokbira Aug 22 '12 at 19:25
    
Note to self: Type faster. –  Mark Allen Aug 22 '12 at 20:04

Start seems to take the first parameter as the title if there's a space in it.

So while this did not work for me:

start "c:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe"

This did: start "" "c:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe"

share|improve this answer
    
Although @maximus answered at first, your answer explain why start does not function with quotes... –  kokbira Aug 22 '12 at 19:31

Use quotes like this:

start "" "Y:\foo bar\xyz"

If the first argument is quoted, start assumes it's the title for the new console window, so launch a new console window. The following argument will then be correctly interpreted as the command to run / file to open.

share|improve this answer

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.