Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I've been working on making a nice little batch script to automaticaly restart a game server upon program crash. The problem is that under Win98 the "/high" switch is not supported for the "start" command so I can't launch the program proccess at high priority. However, I have discovered pv.exe which is a command line program to control/kill processes. According to it's readme the command to set priority is: "pv -ph ProgName.exe >nul". Now the start command I use to run my server EXE is as follows: "start /wait UnrDm.exe DmAriza.unr?Game=UCopLite.UCopDeathmatchgame Log=DmServ.log -server". As you see I need to use the "/wait" switch so that the EXE restarts when the process gets terminated allowing my server restart batch to work as intended. If I use the "pv -ph" command before or after the start line I'll never be able to effectiively set the priority since the program would still be dead either way.
Here is what my batch file looks like (ignore the date/time command stuff) :
*****************UDMSrv.BAT***********************@echo off
echo ********************************
echo Unreal DeathMatch Server Start
echo ************By*Zombie***********echo @PROMPT SET TIME=$T$_> %TEMP%.\T1.BAT
%COMSPEC% /C %TEMP%.\T1.BAT > %TEMP%.\T2.BAT
call %TEMP%.\T2.BAT
for %%? in (1 2) do del %TEMP%.\T%%?.BATecho @PROMPT SET DATE=$D$_> %TEMP%.\T1.BAT
%COMSPEC% /C %TEMP%.\T1.BAT > %TEMP%.\T2.BAT
call %TEMP%.\T2.BAT
for %%? in (1 2) do del %TEMP%.\T%%?.BATecho.
echo TIME=%TIME% DATE=%DATE%
echo *Unreal DeathMatch Server Running...
:start
start /wait UnrDm.exe DmAriza.unr?Game=UCopLite.UCopDeathmatchgame Log=DmServ.log -server
echo.
echo *Unreal DeathMatch Server Crash Occured!
echo.
echo **********************************
echo Unreal DeathMatch Server Restart
echo ************By*Zombie*************echo.
echo TIME=%TIME% DATE=%DATE%
echo *Unreal DeathMatch Server Running Again...
goto start
******************UDMSrv.BAT**********************

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |