Dear all,
I have problem with application. If the application starts everything is ok and the memory of application is about 150MB. Time to time the application doesn't start (not showing the visualization) but in taskbar there is running the application with low memory about 30MB. If I kill the process in taskbar and run again everything is ok. I do not know how to set batch file to kill process after 10s and if the application used low memory.
BR
JohnCZ
Batch file that will kill after 10sec process if the process
Moderator: DosItHelp
Re: Batch file that will kill after 10sec process if the pro
Which version of Windows?
Re: Batch file that will kill after 10sec process if the pro
That may work for you:
You have to customize variable process in line 2 and you may have to define the fully qualified path in the two START command lines e.g.
Regards
aGerman
Code: Select all
@echo off &setlocal
set "process=program.exe"
start "" "%process%"
timeout /t 10 /nobreak
for /f tokens^=9^ delims^=^" %%i in (
'tasklist /nh /fo csv /fi "imagename eq %process%"'
) do for /f %%j in ("%%i") do for /f "tokens=1,2 delims=.," %%k in ("%%j") do (
if %%k%%l lss 50000 (
taskkill /im %process%
start "" "%process%"
)
)
You have to customize variable process in line 2 and you may have to define the fully qualified path in the two START command lines e.g.
Code: Select all
start "" "C:\path of the program\%process%"
Regards
aGerman