Automatically Restart a Process
Go to solution
Solved by xAcid9,
28 minutes ago, Hi P said:the problem is that process either goes up little by little (I've seen it happen), in which case your method would work a 100%
But there are cases when it suddenly goes up, in the span of 5 seconds, from 30 mb to as much RAM as your system has, in which case your method wouldn't stop it from happening
![]()
I Google and mashed up this script.
@echo off setlocal enabledelayedexpansion :start set _mem=0 for /f "skip=3 usebackq tokens=5" %%i in (`tasklist /fi "<process name>"`) do ( set /a _mem += %%i ) echo Total Memory = !_mem! K if !_mem! GTR <memory in KB> taskkill /im <process name.exe> /f endlocal
save as bat file and use Task Scheduler to run it maybe every 60 secs. 
use Task Scheduler hidden option if you don't want to see it popup every minute.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now