Moderatori: Dylan666, hydra, gahan
pv.exe can be easealy executed from a batch file to check if process is running.
When writing a command file please note that the ERRORLEVEL number specifies
a true condition if the last program run returned an exit code equal to or
_greater_ than the number specified.
The following script illustrates how this could be done:
@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
Please note that redirecting standard errors by using 2>file_name does not work under 9x
Windows. Please use "2>file_name" instead. This notation will be processed by pv.exe
@echo off
pv.exe paint.exe > nul
if ERRORLEVEL 1 goto Process_NotFound
:Process_Found
echo Processo in esecuzione CHE BELLO!
goto END
:Process_NotFound
echo Processo NON in esecuzione
goto END
:END
@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
Dylan666 ha scritto:Please note that redirecting standard errors by using 2>file_name does not work under 9x
Windows. Please use "2>file_name" instead. This notation will be processed by pv.exe
Può avere a che fare col mio errore su win ME
Software per sapere quando è stata scattata una foto Autore: nippon |
Forum: Software Windows Risposte: 10 |
Vincolare l’esecuzione di una macro Autore: lone wolf |
Forum: Applicazioni Office Windows Risposte: 4 |
Visitano il forum: Nessuno e 62 ospiti