- Dec
- 236
- 2
I typed in "write a batch command file in JPSoft's "Take Command", that uses the processmonitor command to monitor a process defined on the command line and print the text "Process Exited" when the process terminates." and got:
@echo off
:: Check if process name is provided as an argument
if "%~1"=="" (
echo Please provide the name of the process to monitor.
exit /b 1\
)
:: Run the process monitor with the provided process name
ProcessMonitor /Wait %1 /OnExit ExitHandler
:: End of script
exit /b
:ExitHandler
echo Process Exited
exit /b
@echo off
:: Check if process name is provided as an argument
if "%~1"=="" (
echo Please provide the name of the process to monitor.
exit /b 1\
)
:: Run the process monitor with the provided process name
ProcessMonitor /Wait %1 /OnExit ExitHandler
:: End of script
exit /b
:ExitHandler
echo Process Exited
exit /b