che strano, io ho provato e mi funziona alla grande..
- Codice: Seleziona tutto
@echo off
pv.exe %1 >nul
if ERRORLEVEL 1 goto Process_NotFound
:Process_Found
echo Process %1 is running
goto END
:Process_NotFound
echo Process %1 is not running
goto END
:END
salvato come "test.bat" e lanciato poi da PROMPT
c:\>test explorer.exe
Process explorer.exe is running
C:\>test mspaint.exe
pv: No matching processes found
Process mspaint.exe is not running
-- e dopo aver lanciato paint
C:\>test mspaint.exe
Process mspaint.exe is running
forse non devi mettere il nome del file nel batch, ma usare la variabile e richiamarla da fuori, quando lanci il batch..