Launch PR from batch file

General discussion of the Project Reality: BF2 modification.
Post Reply
Johnboy113
Posts: 9
Joined: 2009-04-20 09:56

Launch PR from batch file

Post by Johnboy113 »

Hi all,

recently returned to PR after a long break and would like to run PR from a batch file.
This is so i can kill extraneous processes before game launch and free some ram up.

i use the taskkill command to force kill the apps i dont need running behind PR (rainlendar 2, Thunderbird, firefox etc) but when i try to put in the command for launching PR it tells me it cant find the exe, even tho it is there and i can see it. i pasted the path from the exe properties window.

Here is the text from my .cmd file:

@echo off
rem Thunderbird off
taskkill /f /IM thunderbird.exe
rem rainlendar off
taskkill /f /IM rainlendar2.exe
rem lexmark off
taskkill /f /t /PID 1964 /PID1260
taskkill /f /t /IM lxdimon.exe
rem RocketDock off
taskkill /f /IM RocketDock.exe
rem Firefox off
taskkill /f /IM firefox.exe
C:\Program Files\EA GAMES\Battlefield 2\mods\pr
start pr.exe
exit

The printer stuff always uses the same PID so i can use PID there but the other stuff has diff PID every launch so i use /IM to kill those.

So my question is: How do I launch PR from command line?

Thanks in advance. Johnboy.
Johnboy113
Posts: 9
Joined: 2009-04-20 09:56

Re: Launch PR from batch file

Post by Johnboy113 »

Figured it out.

Make folder in C: called Batches.
Make shortcut from "C:\Program Files\EA GAMES\Battlefield 2\mods\pr\pr.exe" and place in Batches folder.
Set batch file to reference that shortcut as shown in the batch file below.

@echo off
rem Thunderbird off
taskkill /f /IM thunderbird.exe
rem rainlendar off
taskkill /f /IM rainlendar2.exe
rem lexmark off
taskkill /f /t /PID 1964 /PID1260
taskkill /f /t /IM lxdimon.exe
rem RocketDock off
taskkill /f /IM RocketDock.exe
rem Firefox off
taskkill /f /IM firefox.exe
re run pr
start C:\Batches\projectreality.lnk
cls

this successfully kills the listed non essential programs, freeing up ram, then launches PR.
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: Launch PR from batch file

Post by Psyrus »

Pretty good idea, although mine would include mumble launching & teamspeak launching. As well as auto-logging me into my PR account ^_^

Oh, and 2gb of ram is extraordinarily cheap these days (think US$50 and below for both ddr2 & 3), perhaps consider the investment? :)
Su34
Posts: 97
Joined: 2007-03-02 14:05

Re: Launch PR from batch file

Post by Su34 »

Well, autologin for your Account ist pretty easy:
Just change the "path-line" of the short-cut (I suppose you can also use a shor-cut to start PR with the batch-file) into: "Your Path:\EA GAMES\Battlefield 2\mods\pr\pr.exe" +playerName "your loginname" +playerPassword "your password" +restart"

The "+restart" switches off all the intros of the game ;)
Post Reply

Return to “PR:BF2 General Discussion”