| 1. |
Solve : track a process running time? |
|
Answer» Any commands or code could track a process running time within a batch file? Any commands or code could track a process running time within a batch file? I can no longer modify (edit ) post #1. The modify key is not available. The following batch finds the pid number and a COMMAND line argument allows the name of any process or application. C:\batch>type kill10.bat Code: [Select]@echo off sleep 600 tasklist | findstr "%1" > notepid.txt for /f "tokens=1,2 delims= " %%i in (notepid.txt) do ( echo pid=%%j taskkill /pid %%j ) Output: C:\batch>kill10.bat notepad pid=2284 SUCCESS: Sent termination signal to the process with PID 2284. C:\batch> |
|