小编Ice*_*Ice的帖子

意外使用(批处理文件

在下面的代码中我想终止ABClient.exe,ABClientMonitor.exe如果发现它正在运行.但是,当尝试运行代码时,我收到Unexpected use of (错误

码:

@echo off
color 0b
:loop
tasklist | find /i "ABClient.exe" > nul
set processFound1=%errorlevel%
tasklist | find /i "ABClientMonitor.exe" > nul
set processFound2=%errorlevel%
if %processFound1% == 0 (
    echo ABClient has been detected. Terminating...
    taskkill /f /im "ABClient.exe" > nul
    set process1lvl=%errorlevel%
    if %process1lvl% == 0 (
        echo ABClient has been terminated successfully!
        goto loop2
    ) ELSE (
        echo Failed to terminate ABClient!
        goto loop2
    )
)
:loop2
if …
Run Code Online (Sandbox Code Playgroud)

batch-file

1
推荐指数
1
解决办法
67
查看次数

标签 统计

batch-file ×1