ZoSTeR Posted November 28, 2003 Posted November 28, 2003 I wrote a little menu batch to make the selection of what to install a bit easier.It expects you to have sub folders for every application containing a file _SetupInfo.txt containing a one row file description and a file _SetupBatch.bat with the typical setup commands for unattended installation and of course the setup file itself.That way you avoid editing the batch files for installation if you want to add or remove a specific application on your cd.Please note that CHOICE.exe from the W2K resource kit is required.I'm sure the whole thing can be streamlined a little more especially the dummy FOR commands.We need the V switch for delayed variable expansion (or whatever its called in the english windows)CallMenu.bat :@ECHO OFFCLSCMD /V:ON /C Menu.batMenu.bat :@ECHO OFFCLSSETLOCALrem --- Z is used to avoid problems with the offset later on ---SET Characters=z1234567890abcdefghijklmnopqrstuvwxSET Choices=ySET /A ItemsCount=0rem -- Insert your applications path below --FOR /R Applications %%i IN (_SetupInfo*.txt) DO SET /A ItemsCount+=1 & FOR /F "delims=xxx" %%n in (%%~fi) DO SET ItemText!ItemsCount!=%%n & SET ItemOption!ItemsCount!=x& SET ItemSetup!ItemsCount!=%%~dpi_SetupBatch*.batFOR /L %%j IN (1,1,%ItemsCount%) DO SET Choices=!Choices!!Characters:~%%j,1!:MenuCLSECHO.ECHO.FOR /L %%k IN (1,1,%ItemsCount%) DO ECHO !Characters:~%%k,1!. !ItemOption%%k! !ItemText%%k! ECHO.Choice.exe /C:%Choices% /N /T:Y,20 Toggle selection with keys. Press Y to continue (20 Sec..)IF %Errorlevel% LEQ 1 GOTO EndSET /A ChoiceMade=%Errorlevel% - 1rem --- Dummy FOR Commands to append number to ItemOption ---FOR /L %%l IN (%ChoiceMade%,1,%ChoiceMade%) DO IF "!ItemOption%%l!"=="x" (SET ItemOption%%l=_& GOTO Menu)FOR /L %%m IN (%ChoiceMade%,1,%ChoiceMade%) DO IF "!ItemOption%%m!"=="_" (SET ItemOption%%m=x& GOTO Menu)GOTO Menu:EndFOR /L %%n IN (1,1,%ItemsCount%) DO IF "!ItemOption%%n!"=="x" CMD /C !ItemSetup%%n!ECHO End..ENDLOCALA typical example of how your CD would look like:$OEM$\$1\Install\Applications\AdobeRdr\_SetupInfo.txt_SetupBatch.batAdbeRdr60_deu_full.exe_SetupInfo.txt content:Adobe Reader 6.0 Full Version_SetupBatch.bat content:@ECHO OFFECHO.ECHO InstallingTYPE _SetupInfo.txtECHO Please wait...START /wait AdbeRdr60_deu_full.exe -p"-s /v\"/qn\""Have fun with it and post your improvement tips edit : some typos and ECHO in final execution
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now