в окнах, которые вы можете использовать, pstools pslist, чтобы проверить, запущено ли имя процесса, используя скрипт .cmd, как показано ниже Pslist вернет ERRORLEVEL 0, если процесс запущен, и 1, если нет.
@echo off
CommandYouWillRun.exe
rem waiting for the process to start
:startcmd
sleep 1
c:\path\to\pslist.exe CommandYouWillRun > NUL
IF ERRORLEVEL 1 goto startcmd
rem the process has now started
:waitforcmd
sleep 1
c:\path\to\pslist.exe CommandYouWillRun > NUL
IF ERRORLEVEL 1 got finished
goto waitforcmd
:finished
echo "This is an error message"