问题描述
我有一个设置脚本,我在开始我需要的所有程序早上跑步。现在,其中的一些需要环境额外的设置,所以我需要将它们包装在小蝙蝠脚本。
I have a "setup" script which I run in the morning which starts all the programs that I need. Now some of those need additional setup of the environment, so I need to wrap them in small BAT scripts.
我如何在后台运行在Windows XP上这样一个剧本?
How do I run such a script on Windows XP in the background?
调用env-script.bat
运行它同步,即安装脚本只能在ENV脚本已终止命令后继续。
CALL env-script.bat
runs it synchronously, i.e. the setup script can continue only after the command in the env-script has terminated.
START / B ENV-script.bat
运行在相同的命令提示符的cmd.exe另一个实例,把它留在一个非常的混乱状态(我看到的输出嵌套的CMD.exe,键盘是死了一段时间,不执行脚本)。
START/B env-script.bat
runs another instance of CMD.exe in the same command prompt, leaving it in a really messy state (I see the output of the nested CMD.exe, keyboard is dead for a while, script is not executed).
START / B CMD ENV-script.bat
产生同样的结果。在CMD标志似乎都不符合我的账单。
START/B CMD env-script.bat
yields the same result. None of the flags in CMD seem to match my bill.
推荐答案
其实,下面的工作正常,我并创造了新的窗口:
Actually, the following works fine for me and creates new windows:
TEST.CMD:
@echo off
call "cmd /c start test2.cmd"
call "cmd /c start test3.cmd"
echo Foo
pause
test2.cmd
test2.cmd
@echo off
echo Test 2
pause
exit
test3.cmd
test3.cmd
@echo off
echo Test 3
pause
exit
再加上参数的启动
,如 /分钟
,因为摩西指出,如果不这样做希望新的窗口,在你的面前产卵。
Combine that with parameters to start
, such as /min
, as Moshe pointed out if you don't want the new windows to spawn in front of you.
这篇关于我如何运行在从另一个bat文件在后台一个bat文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!