Last active
August 29, 2015 14:05
-
-
Save glucero/45b7da093a861536ca56 to your computer and use it in GitHub Desktop.
monitor process status with command output template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SETLOCAL EnableExtensions | |
SET PROCESS=%~nx1 | |
SET NAME=%~n1 | |
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %PROCESS%"') DO IF %%x == %PROCESS% GOTO FOUND | |
ECHO OS^|Windows^|Process^|%NAME%^|Status 0 2 %NAME% (%PROCESS%) is not running. | |
GOTO EOF | |
:FOUND | |
ECHO OS^|Windows^|Process^|%NAME%^|Status 1 0 %NAME% (%PROCESS%) is running. | |
:EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
process_status.bat MyProcess.exe