help with starting explorer after game quits start /wait equivalent??

From: Louis De Pointe Du Lac (louisd...)


i currently use a small application called prioaff.exe to force bf2 to run
in realtime priority and to set its affinity to cpu 1, rather than manually
doing so each time.
i use it in a command line format alongside my bf2 desktop shortcut:
%windir%\prioaff.exe 3 10 "D:\Program Files\EA GAMES\Battlefield 2\BF2.exe"
+playerName DennisDahmer +playerPassword AsIf? +menu 1 +widescreen 1 +szx
1920 +szy 1200 +modPath mods/BF2SP64 +ignoreAsserts 1 +restart
the initial calling of prioaff with the preceeding 3 (realtime priority) and
10 (binary cpu mask 1) it then launches the bf2 exe with those paramaters
stuck fast. works perfectly.

i have since compiled a simple batch file that auto-loads at startup
stopping all unwanted processes and killing every app inlcuding explorer,
just for whilst i play bf2. after doing all this, i am left with a blank
screen, no shell of course! and a dos menu asks me which flavour of bf2 i
want to launch, sf, ef, sp64 etc etc, or quit back to desktop, launching
explorer and putting the processes and applications back to how they were
initially. thats fine.
but a small thing that is bugging me, is the fact that after i finish bf2 i
would like explorer to simply get invoked., now i am aware that the /wait
option in front of the start command will pause the batch file at this point
and not resume till after the specified program in the start line has
exited. and i can achieve this easily without the prioaff line included. but
because i have eseentially the prioaff app callng bf2, the /wait command
doesnt work

eg. start %windir%\prioaff.exe 3 10 "D:\Program Files\EA GAMES\Battlefield
2\BF2.exe" +playerName DennisDahmer +playerPassword AsIf? +menu 1
+widescreen 1 +szx 1920 +szy 1200 +modPath mods/BF2SP64 +ignoreAsserts 1

the above works, but i cant have explorer starting after quitting game.

cd "D:\Program Files\EA GAMES\Battlefield 2"
start /wait %windir%\prioaff.exe 3 10 bf2.exe +playerName DennisDahmer
+playerPassword AsIf? +menu 1 +widescreen 1 +szx 1920 +szy 1200 +modPath
mods/BF2SP64 +ignoreAsserts 1 +restart

start %windir%\explorer.exe

the above doesnt work with the added /wait command as it is waiting for the
prioaff.exe to end to start explorer, but in a way this particular
application never truly gets 'launched' for it to end. it simply applies
system attributes silently to the specified app.
i did try putting the wait command after the 3 10 and before bf2.exe, but
that makes prioaff terminate or chuck up an error.

i guess with all my babbling, i am asking if anyone knows of a way,
preferably without any 3rd party software (trying to be as lean as i can) to
launch explorer AUTOMATICALLY and IMMEDIATELY after the bf2 game ends

i know it sounds ever so trivial to save me having to ctr-alt-del -->new
task-->explorer but what are computers for if not to automate stuff and to
enter into a love hate relation with? ;-)

any pointers, or ideas gratefully appreciated!

p.s. os is xp pro sp2

Share |