wwwwww吧 关注:209贴子:255
  • 0回复贴,共1
@璐村惂鐢ㄦ埛_000076K馃惥 off
setlocal enabledelayedexpansion
:start_program
start "" "C:\path\to\your\program.exe"
timeout /t 5
:: 使用WMIC获取程序的PID
for /f "tokens=*" %%i in ('wmic process where "name='program.exe'" get ProcessId ^| findstr /r "[0-9]"') do (
set program_pid=%%i
)
echo Program PID: !program_pid!
timeout /t 60
taskkill /f /pid !program_pid!
goto start_program


IP属地:重庆1楼2023-12-25 12:18回复