Page 1 of 1

Launch PR from batch file

Posted: 2009-11-22 10:58
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.

Re: Launch PR from batch file

Posted: 2009-11-22 11:51
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.

Re: Launch PR from batch file

Posted: 2009-11-22 18:45
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? :)

Re: Launch PR from batch file

Posted: 2009-11-22 20:23
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 ;)