views:

8266

answers:

5

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 JSTYONS-DELPHI -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?

@AlbertEin: Yes, I tried that. No luck.

@Mark Allen: Yes, tried that too. No error; it just leaves a blank dos prompt.

@Tim Farley: That worked. Thanks!

@Ferruccio: That is a better idea, with the bonus that I get a pretty icon instead of a little cog-in-a-box. "Answered" goes to Tim though, since he did answer the specific qstn.

+1  A: 

have you tried:

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

?

AlbertEin
A: 

Put the command inside a batch file, and call that with the parameters.

Also, did you try this yet? (Move end quote to encapsulate parameters)

start "c:\program files\Microsoft Virtual PC\Virtual PC.exe -pc JSTYONS-DELPHI -launch"
Mark Allen
+9  A: 

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 JSTYONS-DELPHI -launch

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

Tim Farley
"peculiarity" is being nice...
Michael Burr
+1  A: 

Instead of a batch file, you can create a shortcut on the desktop.

Set the target to:

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

and you're all set. Since you're not starting up a command prompt to launch it, there will be no DOS Box.

Ferruccio
A: 

START /PGM "C:\Program Files\Microsoft..."

will also do what you want.

Edit: My mistake, /PGM is a parameter of the 4NT start command, not the one in cmd.exe.

Graeme Perrow
The /PGM switch must be new with Vista - it doesn't work on my WinXP SP2 box.
Michael Burr