Click to See Complete Forum and Search --> : batch file script


dan185818
11-09-2004, 11:33 AM
Hey all,
I have four programs that I might have to install when we get a new computer. I cannot create an image as the company is not big enough to warrant spending the money on the software for how little it would be used (I get two or three computers at a time, with different hardware). I have to install two programs on all the computers, and the other two programs depending on who gets the computers. I currently have four .bat files that do this (along with some other file system changes, copying and deleting), one for each combination. What I would like to do is create a script that will take switches on the command line and copy the required files, and install the other programs according to the switches (possibly /r for to install Adobe Reader since some of the computers have the full Acrobat, and others don't have any). Does anyone know how this could be done using batch files (.bat) in Windows XP? If not using .bat's, can anyone point me to some good VBS or similar language sites that will show me how to do this? I have a little experience in VB, C++, and Java.
Thanks,
Danny

ua549
11-09-2004, 01:05 PM
Here is a simple batch file script.

Under each option label you can put your existing commands or a CALL statement to process other batch files. The option you want is a number following the name of the batch file. For example Test 4 to use option 4.

:p0
rem Put valid option checking here
goto :p%1
exit

:p1
echo option1
goto :eof

:p2
echo option2
goto :eof

:p3
goto :eof
echo option3

:p4
echo option4
goto :eof