Board logo

标题: [其他] 求助批处理判断某些进程如果存在则结束指定程序,如果不存在则运行程序 [打印本页]

作者: ijevil    时间: 2021-11-15 16:44     标题: 求助批处理判断某些进程如果存在则结束指定程序,如果不存在则运行程序

开机运行程序A.exe

如果进程里面检测到了这些程序("Steam.exe" "steam.exe" "Origin.exe" "EpicGamesLauncher.exe" "steamchina.exe" "Battle.net.exe" "crossfire.exe" "crossfire_x64.exe" "aion.bin" "aion.bin" "cstrike-online.exe" "TGame.exe" "JX3ClientX64.exe" "GacRunnerNG.exe" "YuanShen.exe" "WorldOfTanks.exe" "WorldOfWarships64.exe" "WargamingErrorMonitor.exe" "PES2021.exe" "GameApp.exe" "GTA5.exe" "qsgame.exe" "qqx51_game.exe" "EscapeFromTarkov.exe" "DNF.exe" "NarakaBladepoint.exe" "NeacClient.exe")则结束A.exe

如果这些进程("Steam.exe" "steam.exe" "Origin.exe" "EpicGamesLauncher.exe" "steamchina.exe" "Battle.net.exe" "crossfire.exe" "crossfire_x64.exe" "aion.bin" "aion.bin" "cstrike-online.exe" "TGame.exe" "JX3ClientX64.exe" "GacRunnerNG.exe" "YuanShen.exe" "WorldOfTanks.exe" "WorldOfWarships64.exe" "WargamingErrorMonitor.exe" "PES2021.exe" "GameApp.exe" "GTA5.exe" "qsgame.exe" "qqx51_game.exe" "EscapeFromTarkov.exe" "DNF.exe" "NarakaBladepoint.exe" "NeacClient.exe")退出了,也就是进程里面没有检测到这些进程,则重新运行A.exe

循环检测这些进程,有就结束A.exe,没有就重新运行A.exe

运行环境 Windows10 1809 或者 21h1
作者: Batcher    时间: 2021-11-15 17:35

回复 1# ijevil


    这27个进程全部存在才结束A.exe?还是只要其中一个存在就结束A.exe?
作者: ijevil    时间: 2021-11-15 20:38

回复 2# Batcher


    只要有一个就结束




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2