Using the "start" command with parameters passed to the started program

JosephStyons picture JosephStyons · Sep 30, 2008 · Viewed 351.1k times · Source

I have a Virtual Machine in Virtual PC 2007.

To start it from the desktop, I have the following command in a batch file:

"c:\program files\Microsoft Virtual PC\Virtual PC.exe" -pc "MY-PC" -launch

But that leaves a dos prompt on the host machine until the virtual machine shuts down, and I exit out of the Virtual PC console. That's annoying.

So I changed my command to use the START command, instead:

start "c:\program files\Microsoft Virtual PC\Virtual PC.exe" -pc MY-PC -launch

But it chokes on the parameters passed into Virtual PC.

START /? indicates that parameters do indeed go in that location. Has anyone used START to launch a program with multiple command-line arguments?

Answer

Tim Farley picture Tim Farley · Sep 30, 2008

START has a peculiarity involving double quotes around the first parameter. If the first parameter has double quotes it uses that as the optional TITLE for the new window.

I believe what you want is:

start "" "c:\program files\Microsoft Virtual PC\Virtual PC.exe" -pc MY-PC -launch

In other words, give it an empty title before the name of the program to fake it out.