gpt4 book ai didi

batch-file - 进程结束后执行命令的批处理文件

转载 作者:行者123 更新时间:2023-12-05 01:20:55 27 4
gpt4 key购买 nike

我正在制作一个启动程序的批处理文件,例如 notepad.exe。我需要它在我手动关闭 notepad.exe 后执行命令。

我只知道要执行此操作,批处理文件必须验证进程 notepad.exe 是否正在运行。

如何让它在我手动关闭记事本窗口时准确地验证这一点?

最佳答案

如果您正在使用start,您可以/wait让程序完成,然后再运行任何命令:

(commands)

start "" /wait notepad.exe

(commands to run here)

notepad.exe 替换为程序的路径。也可以在notepad.exe后添加参数传递给程序。

程序将等待 notepad.exe 先关闭,然后再运行下面的命令。

关于batch-file - 进程结束后执行命令的批处理文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17761037/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com