PDA

View Full Version : Batch file + close explorer while StarCraft is running?



Cortexian
September 14th, 2009, 04:23 AM
Alright so I've recently been using a batch file with the following contents to launch StarCraft. Basically it closes explorer.exe, launches StarCraft.exe, then launches explorer.exe again after StarCraft closes. This fixes the color issues that come with running StarCraft on Windows Vista or Windows 7:


taskkill /f /IM explorer.exe
C:\"Program Files (x86)"\"StarCraft"\"StarCraft.exe"
start explorer.exe


Now, just today I was playing around with a program that lets you run StarCraft at a higher resolution, it's called "StarCraft Resolution Expander 5.1" and it uses a loader to launch the game... Unfortunately this messes up my previous way of launching the game since the loader that you use to launch StarCraft doesn't continue to run after you load it, so explorer.exe restarts before StarCraft is even loaded if I use the following script:


taskkill /f /IM explorer.exe
C:\"Program Files (x86)"\"StarCraft"\"InsectLoader.exe"
start explorer.exe


So this is what I need to have happen:


Kill explorer.exe
Run InsectLoader.exe

This will launch StarCraft.exe as well


Restart explorer.exe after StarCraft.exe stops running

So does anyone know a command that monitors to see if a specified executable is running before moving onto the next command in the script or something? If I could do something like the following it would be great:


taskkill /f /IM explorer.exe
C:\"Program Files (x86)"\"StarCraft"\"InsectLoader.exe"
if (StarCraft.exe is running)
{
WAIT
}
else
{
start explorer.exe
}


Obviously that wouldn't work, since it's a combination of like three types of scripts, lol.

Help?

Cojafoji
September 14th, 2009, 04:53 AM
taskkill /f /IM explorer.exe
C:\"Program Files (x86)"\"StarCraft"\"InsectLoader.exe"
@ping www.google.com (http://www.google.com)
@ping www.google.com (http://www.google.com)
@ping www.google.com (http://www.google.com)
start explorer.exe

*edit: there is no choice or wait command in windows 2000 or later. sorry free. the longer you want the bat to wait, just add more ping sets. it's crude, but it works. you can use any web site. it usually takes about 3 seconds per ping operation at a normal connection.

or
taskkill /f /IM explorer.exe
C:\"Program Files (x86)"\"StarCraft"\"InsectLoader.exe"
ping localhost -n 20 > nul
start explorer.exe

Cortexian
September 14th, 2009, 06:02 AM
Yea but I don't want explorer.exe to start again until I'm finished playing StarCraft, and that takes varying amounts of time.

Would it be possible to make a "Press any button to continue" section that's right before the "start explorer.exe"? I can deal with pressing a key after closing the game.

E:


taskkill /f /IM explorer.exe
C:\"Program Files (x86)"\"StarCraft"\"InsectLoader.exe"
pause
start explorer.exe


???

Pyong Kawaguchi
September 14th, 2009, 06:05 AM
I think there is an input command of some sort, I'm not sure though.

Cortexian
September 14th, 2009, 07:20 AM
Got it, it is the pause command. I spruced up the script and made it pretty, here it is (http://freelancer.lancersedge.com/downloads/StarCraft%20Resolution%20Expander%205.1.zip) bundled with Resolution Expander 5.1 for all of you playing StarCraft on Vista/7!

Now someone change the thread title to "How to play StarCraft at higher resolutions" or something!

sdavis117
September 14th, 2009, 07:34 AM
This can be re-engineered for other games, right?

Cortexian
September 14th, 2009, 08:07 AM
This can be re-engineered for other games, right?
To close explorer while the game is running and then restart it with the press of a key use this script:


@echo off
echo 1) Press any key to contine from this screen
echo 2) Wait for YourGame to load
echo 3) When you're done playing, close YourGame normally
echo and follow the instructions to restart explorer
pause
taskkill /f /IM explorer.exe
echo Explorer disabled, now launching YourGame...
PING 1.1.1.1 -n 1 -w 10000 >nul
start /wait YourGameExecutable.exe
PING 1.1.1.1 -n 1 -w 10000 >nul
cls
echo If you closed YourGame, press any key to restart explorer
pause
start explorer.exe
end


Should be self explanatory.

Cortexian
September 14th, 2009, 07:21 PM
Awesome hellinsect (the creator of the Resolution Expander) says he might go back and fix some of the errors in the program, as well as add triple-monitor resolution support up to the point where the width hits the edges of the map! I can't wait to try out StarCraft on triple-monitors... :pcgaming: :ohboy:

Cortexian
September 15th, 2009, 12:52 AM
Resolution Expander now works with 1920x1200 and 2560x1600, hellinsect is having me test his latest builds before he releases them but there should be a new one soon!

Anyone know how to record StarCraft, Fraps lags like HELL to the point of the game being unplayable. Everything I've read says that you need to use Camtasia Studio + Camtasia Recorder but every time I try I just get a black screen with white pixels representing the brightest areas of the recording...