1

I'm pretty new to batch files, so keep that in mind. I'm trying to write a script that launches a game, waits 30 seconds, then sets the priority of the game to high. Originally it looked like this:

cd "...\Stepmania Etterna\Program\"
Start StepMania.exe
ping 127.0.0.1 -n 30 > nul
wmic process where name="StepMania.exe" CALL setpriority 128
pause

That was not working, but it does work when I write the exact same wmic line in a separate cmd when the process is open. I then got the idea of launching another bat file with just the wmic line from the original and removing the wmic line in the original. That works, but I'm thinking there has to be a better way to it than launching two scripts. So my question is, why isn't the command working in the example above, but it works when I write the exact same command into a separate cmd? And is there a way to fix this?

EDIT: It seems like the game in question is resetting process priority to normal whenever I enter the main menu, but that shouldn't be an issue considering I'm waiting 30 seconds and I am way past the main menu whenever the process priority should be changed by the script. Not sure if that is relevant, but its just something I noticed.

0

You must log in to answer this question.

Browse other questions tagged .