Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for /f "tokens=1 delims=: " %A in ('tasklist /FI "IMAGENAME eq python.exe" /NH') do (
- If "%A" == "python.exe" (
- echo "It's running"
- ) Else (
- echo "It's not running"
- )
- )
- for /F "tokens=1 delims=: " %A in ('tasklist /FI "IMAGENAME eq python.exe" /NH 2^>^&1') do (
- if "%A"=="python.exe" (
- echo "It's running"
- ) else (
- echo "It's not running"
- )
- )
- @echo off
- for /f "tokens=1 delims=: " %%A in ('tasklist /FI "IMAGENAME eq java.exe" /NH') do (
- If "%%A" == "java.exe" (
- echo "It's running"
- ) Else (
- echo "It's not running"
- )
- )
- @echo off
- set found=0
- for /f "tokens=1 delims=: " %%A in ('tasklist /NH') do (
- If /i "%%A" equ "python.exe" (
- set found=1
- )
- )
- if %found%==1 (
- @echo It's running
- ) else (
- @echo It's not running
- )
- Set RUNNING=False
- for /f "tokens=1 delims=: " %%a in ('tasklist /FI "IMAGENAME eq python.exe" /NH 2^>NUL') do (Set RUNNING=True)
- If %RUNNING% == True (
- @Echo It IS running
- ) ELSE (
- @Echo It's NOT running
- )
Add Comment
Please, Sign In to add comment