Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
567 views
in Technique[技术] by (71.8m points)

windows - 如何从批处理文件运行程序,而在程序启动后不使控制台处于打开状态?(How can I run a program from a batch file without leaving the console open after the program starts?)

For the moment my batch file look like this:

(目前,我的批处理文件如下所示:)

myprogram.exe param1

The program starts but the DOS Window remains open.

(程序启动,但DOS窗口保持打开状态。)

How can I close it?

(我该如何关闭?)

  ask by Mister Dev translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use the start command to prevent the batch file from waiting for the program.

(使用start命令来防止批处理文件等待程序。)

Just remember to put a empty double quote in front of the program you want to run after "Start".

(只需记住在“启动”之后要运行的程序前面加一个空的双引号即可。)

For example, if you want to run Visual Studio 2012 from a batch command:

(例如,如果要从批处理命令运行Visual Studio 2012:)

Start ""  "C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDEdevenv.exe"

notice the double quote after start.

(注意启动后的双引号。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...