PDA

View Full Version : Request help with writing batch program


Doolittle81
08-05-09, 07:25 PM
Could someone help me with writing a batch program. I need a batch program that will randomly select (and rename?) a file from a folder of files so that the generic file will be replaced and the newly selected file will run in its stead. Okay..confusing, it sounds. For example, in Silent Hunter, the Girl in Every Port MOD is a program (Batch?) which can be run which selects a JPG file from a folder of several hundred variously name files, apprently renames the selected file to the required default file name recognized by the game 'code', and the selected JPG Picture appears in-Game. If anyone understands what I am looking for, and could write such a program using some sort of "Demo-Filler" folder and file names, I could possibly adapt the folder/file names to my needs. (If I can find out how to open and read/rewrite such a batch.exe or *.Bat file/program)

Any help or tutorial guidance will be greatly appreciated.

Pisces
08-06-09, 02:51 PM
As far as my DOS memory spans backwards (so no 640k barrier involved ;) ) batchfiles don't have the ability to generate random values/variables. Such a function (special selection of a file) would usually be done bu writing a small console application that returns the filename.

Perhaps you can perform your desired function with the more modern Windows scripting languages VBscript or Jscript (can't help here unfortuneatly):

http://msdn.microsoft.com/en-us/library/ms950396.aspx

Doolittle81
08-14-09, 11:57 PM
Still looking for help...anyone seen Digital Trucker on the Forum lately????

Doolittle81
08-16-09, 01:33 AM
Sorry....Another Bump... I really need this help!

Munchausen
08-16-09, 05:15 PM
Do a Google search for "Batch Files" or "DOS Commands" ... you should find one or two good tutorials. Depending on your OS, you might also need to download and install a "recent" version of DOS from Microsoft.

Doolittle81
08-16-09, 10:00 PM
Thanks. I might be making some progress...

Munchausen
08-17-09, 01:59 PM
:cool: This might help: typing "edit" (without the quotes) into the Start -> Run window will open a blank DOS page ... use the menu bar at the top of the page same as for a standard Windows program.