Script: DOS Menu Batch File

sam.aaron/ September 21, 2010/ Daily/ 0 comments

Earlier today, I created a batch file to handle a small delima I was having. I have been assigned a project to build an Application Installation Image (ISO). This ISO will need testing in three different environments (DEV = A, QB = B, PROD = C). The ISO is exactly the same except for the config files. The config files are geared for each individual environment (A, B, & C). In the past, the ISO had to be rebuilt each time for each different environment because the config files had to be included within the Application build. The rebuild process took several hours. Instead of rebuilding the ISO for each individual environment to test in, my co-workers and I decided to build one Golden Image, move all of the config files into a central location, and copy only the needed config files into the application folder (overwriting the ones that were installed from the Golden Image). Once the ISO has been given the green light to be deployed to the company, we would then install the final config files within the final Application ISO build.


For example:
Golden Application Image (base_env) is installed on WIN XP. Testing with Development is needed (Env A). Copy “Env A” config files to the Application folder on the XP machine. Then when testing is needed in other groups (ie., QA – Env B, and Prod – Env C), all that would be needed is to copy “Env B” and “Env C” config files when needed.

I’ve been copying the files over both via command-line and using ‘Explorer’. I wanted to make this simpler, so I created a DOS based menu within a batch file. Since I haven’t used batch scripting in a while, I wanted to share my code. I’ve modified this code so that my company’s info is not shared publicly. I made reference to this website during the writing of the code.

You can download a copy of this batch file here.

Print Friendly, PDF & Email
Share this Post