如何关闭由另一个批处理文件启动的批处理文件的命令窗口

时间:2022-08-22 16:02:51

I created a perl script which starts another script. But the started script must be closed after it has performed its task. How can I do it? I have tried the EXIT command but i didnt work.

我创建了一个启动另一个脚本的perl脚本。但是,在执行完任务后,必须关闭已启动的脚本。我该怎么做?我尝试过EXIT命令,但我没有工作。

2 个解决方案

#1


If you start CMD with the /C parameter it will terminate when the command is finished.

如果使用/ C参数启动CMD,它将在命令完成时终止。

#2


This would probably work:

这可能会奏效:

@ECHO off
CALL environment.bat
cmd.exe /c perlScript1.pl
cmd.exe /c perlScript2.pl
START /MIN perlScript3.pl
cmd.exe /c cleanup.bat
timeout 5

#1


If you start CMD with the /C parameter it will terminate when the command is finished.

如果使用/ C参数启动CMD,它将在命令完成时终止。

#2


This would probably work:

这可能会奏效:

@ECHO off
CALL environment.bat
cmd.exe /c perlScript1.pl
cmd.exe /c perlScript2.pl
START /MIN perlScript3.pl
cmd.exe /c cleanup.bat
timeout 5