windows 如何在不等待批处理文件的情况下启动应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2937569/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to start an application without waiting in a batch file?
提问by Mark Attwood
Is there any way to execute an application without waiting in batch file? I have tried the start
command but it just creates a new command window.
有没有办法在不等待批处理文件的情况下执行应用程序?我已经尝试过该start
命令,但它只是创建了一个新的命令窗口。
回答by Joey
I'm making a guess here, but your start
invocation probably looks like this:
我在这里进行猜测,但您的start
调用可能如下所示:
start "\Foo\Bar\Path with spaces in it\program.exe"
This will open a new console window, using “\Foo\Bar\Path with spaces in it\program.exe” as its title.
这将打开一个新的控制台窗口,使用“\Foo\Bar\Path with space in it\program.exe”作为标题。
If you use start
with something that is (or needs to be) surrounded by quotes, you need to put empty quotes as the first argument:
如果您使用start
(或需要)被引号包围的东西,则需要将空引号作为第一个参数:
start "" "\Foo\Bar\Path with spaces in it\program.exe"
This is because start
interprets the first quoted argument it findsas the window title for a new console window.
这是因为start
将它找到的第一个带引号的参数解释为新控制台窗口的窗口标题。
回答by Shital Shah
If your exe takes arguments,
如果您的 exe 接受参数,
start MyApp.exe -arg1 -arg2
回答by Ed Bayiates
I used start /b for this instead of just start and it ran without a window for each command, so there was no waiting.
我为此使用了 start /b 而不仅仅是 start 并且它运行时每个命令都没有窗口,所以没有等待。
回答by egrunin
If start
can't find what it's looking for, it does what you describe.
如果start
找不到它要找的东西,它会按照你的描述做。
Since what you're doing should work, it's very likely you're leaving out some quotes (or putting extras in).
由于您正在做的事情应该有效,因此您很可能会遗漏一些引号(或添加额外内容)。