0

I am trying to execute command from Windows CMD

cmd /c "timeout 3 > nul & start /min C:\Users\Me\Documents\Path with extra spaces\myapp.exe"

Since path contain spaces I would need to place quotes around it in order to specify correct location. I have tried number of ways so far(extra double quotes "", escapes ^), non of them worked yet. Like this:

cmd /c "timeout 3 > nul & start /min """C:\Users\Me\Documents\Path with extra spaces\myapp.exe""""

Command have to be run exactly from CMD.

Kirill Pashkov
  • 3,118
  • 1
  • 15
  • 20
  • [\[ This \]](http://stackoverflow.com/questions/1851012/set-a-path-variable-with-spaces-in-the-path-in-a-windows-cmd-file-or-batch-file) might help.. – sjsam Jun 17 '16 at 12:47
  • Check http://stackoverflow.com/q/355988 (hint: Use /S) – Krii Jun 17 '16 at 12:51

1 Answers1

3

start takes the first quoted parameter as a windows title. So give it a dummy title (for example an empty string ""):

cmd /c "timeout 3 > nul & start "" /min "C:\Users\Me\Documents\Path with extra spaces\myapp.exe""
Stephan
  • 53,940
  • 10
  • 58
  • 91