标题: 监视进程
[打印本页]
作者: 5488
时间: 2007-11-27 20:56
标题: 监视进程
能否编写一个监视进程的脚本,最好能记录它的起始时间和结束时间。
作者: s11ss
时间: 2007-11-27 23:23
早前写的:
@echo off
set ProcessToDealWith=%1
if "%ProcessToDealWith:~-4%" neq ".exe" goto End
:Monitoring %1
title Monitoring %1...
(tasklist|find "%1" && goto Appeared || goto Monitoring %1)
:Appeared
title Appeared!
set /p DeleteProcessOrNot=Do you want to delete it(them)?(Y/N):
if %DeleteProcessOrNot% equ Y taskkill /im "%1"
if %DeleteProcessOrNot% equ y taskkill /im "%1"
goto End
:End
echo.