
tasklist /fi "ImageName eq hercules.exe" /fo csv 2>NUL | find /I "hercules.exe">NUL
if "%ERRORLEVEL%"=="0" goto AlreadyRunning

Echo *** Starting Server - Please Wait ***

del \Emu\Hercules\mvs\prt???.txt>nul
del \Emu\Hercules\mvs\mvslog.txt>nul
del \Emu\Hercules\mvs\prt???.txt2.pos>nul
del \Emu\Hercules\mvs\mvslog.txt2.pos>nul

cd \Emu\Hercules
set path=%path%;%cd:~0,1%:\Emu\Hercules;%cd:~0,1%:\Emu\Hercules\Regina;
cd mvs
start "Hercules_Server" hercules -f conf/mvs.cnf
\utils\sleep 2

cd \Emu\Hercules\x3270
start "wc3270_Terminal" wc3270.exe +S "herc.wc3270"
cd \Utils\AutoHotkey
AutoHotkeyU32.exe ServerStart.ahk
Echo *** Server Started ***
:AlreadyRunning