Monday 15 August 2011

Windows - kill process with a certain uptime -



Windows - kill process with a certain uptime -

i looking way kill processes matching name if (and if) uptime 4hours+

i plan schedule script every hr or observe , kill processes matching criterias.

i have been googling around solutions batch, powershell , vbscripts did not find matching needs. help apreciated!

sorted:

get-process -name process_name_goes_here | foreach-object {if((new-timespan -start (get-process -id $_.id).starttime).hours -ge 4){stop-process $_.id -force}}

windows process kill uptime

No comments:

Post a Comment