Fancy batching?

Soldato
Joined
2 Jun 2007
Posts
6,839
Location
Mornington Crescent
Right, I play an online game that uses a launcher. The graphics are stored in the /img directory in the game folder. There are lots of downloadable launchers that use different graphics, and I like several of them.

Is there some batch command I could use or something that would randomly select a folder to use, and rename it to 'img' so the game loads that launcher graphics, then when the game is closed, changes the name back to something else?


Assuming I've not made myself clear, here's a pictue to help.
http://img235.imageshack.us/img235/7690/imgez4.jpg

In the game folder, there is the img folder that the launcher graphics load from. And there are 5 other folders with img in their name, each having the graphics for a different launcher. Is there some way of randomly changing which launcher graphics are used, or something?

Thanks in advance.
 
Thanks, I've managed that partly - I've renamed all the folders to remove the " img" from their name. Then made a .bat command with the following:

Code:
rename DN img
"D:\Program Files\Softnyx Canada\GunBound Classic\GunBound.exe"
rename img DN

I run this while not having a folder called img, and it renames the DN folder and the launcher starts fine, and I can login. However, it doesn't rename the folder back to img after. I'm guessing this may be because the folder is still in use when it tries to rename it?
Also, while this is a step in the right direction, is there any way to make it randomly select one of the folders to rename (As long as it doesn't try to rename one of the game folders). What about creating one batch file to rename each folder, then a seperate batch file that randomly runs one of those?
 
Well, in case anyone is wondering/cares, I've pretty much got it sorted.

Code:
copy tach img
"D:\Program Files\Softnyx Canada\GunBound Classic\GunBound.exe"
pause
del "D:\Program Files\Softnyx Canada\GunBound Classic\img" /q /f

One batch file as above for each launcher folder. And each batch file should be named from 0-9
Code:
"D:\Program Files\Softnyx Canada\GunBound Classic\%random:~-1%.bat
That creates a random number from 0-9 then runs the batch file with that name :D

Its still a bit annoying that I have to use the pause command, but if I just delete the contents of the /img folder straight away, then it just doesn't work.
 
Thanks.
I was planning on changing it to a rename command later this evening. I used to have it as one, but I was still having the problem of it not renaming it after because the files were still in use. However, deleting it didn't work either, and I never got around to changing it back.

I'll try out that wait command, though what does it actually do? I'm not sure if it will work, since the gunbound.exe launches the game through the file gbc.yiff. Gunbound.exe then closes, but a couple of the files in the launcher folder stay in use untill the program is closed.
edit: Also just realised. Which the cmdow would be very handy, its not that much use if you need to press any key on the command prompt, only for there to be no window :P
 
Last edited:
Just tried that. However, as I said, gunbound.exe launches gbc.yiff then closes as soon as you enter your password. So the wait command doesn't work, since gunbound.exe closes, but gbc.yiff is still accessing some of the files in the /img folder.

Flow chart thingy of what happens:
1. run the bat
2. renames tach to img
3. Runs gunbound.exe, which loads the graphics from the /img folder
4. Enter password
5. gunbound.exe launches gbc.yiff
6. gbc.yiff accesses files from the /img folder
7. gunbound.exe closes
8. bat file tries to rename img folder, can't since its still being used.
 
No, sorry. Its working using the pause. Wait isn't any good since gunbound.exe ends while the files in /img are being accessed, so the rename fails.
 
Back
Top Bottom