使用“开始”按钮,将其设置为“开始”。参数传递给启动程序的命令 [英] Using the "start" command with parameters passed to the started program

查看:67
本文介绍了使用“开始”按钮,将其设置为“开始”。参数传递给启动程序的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Virtual PC 2007中有一个虚拟机。

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

但这会在主机上留下dos提示,直到虚拟机关闭,然后我退出虚拟机PC控制台。

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.

所以我将命令更改为使用START命令,

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

但是它会阻塞传入Virtual PC的参数。

But it chokes on the parameters passed into Virtual PC.

START /?表示参数确实在该位置。有人使用START启动带有多个命令行参数的程序吗?

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

推荐答案

START具有特殊性,其中第一个引号周围有双引号参数。如果第一个参数具有双引号,它将使用它作为新窗口的可选TITLE。

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.

我相信您想要的是:

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.

这篇关于使用“开始”按钮,将其设置为“开始”。参数传递给启动程序的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆