Computing.Net > Forums > Disk Operating System > Batch File Q About Process Priority

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File Q About Process Priority

Reply to Message Icon

Name: Zombie9246
Date: February 9, 2003 at 01:33:09 Pacific
OS: Windows 98 First
CPU/Ram: 1 GHz PIII / 192MB SDRAM
Comment:

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%%?.BAT

echo @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%%?.BAT

echo.

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**********************



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch File Q About Process Priority

Batch file to kill processes www.computing.net/answers/dos/batch-file-to-kill-processes/13104.html

BATCH FILES www.computing.net/answers/dos/batch-files/9689.html

Batch file dial up www.computing.net/answers/dos/batch-file-dial-up/5599.html