'Installing list of programs using batch files [closed]
I wish to make a batch file that installs multiple programs
:INSTALLER
1. 7-Zip
2. Adobe Creative Cloud
...
...
44. WinRAR
45. WizTree
46. Zoom
Just asking before making one, What is the best way implementing this?
My Answer is given below:
Solution 1:[1]
All these actions are essentially the same steps with different data. Use a function.
A function is a label that is called with parameters to act upon.
After your input prompt, validate your input, then assess which path to pass to the function as the second parameter.
Call :InstallPrompt "Installee Descriptor" "Installees Filename.ext"
An example of all your labels reduced to a single function.
:InstallPrompt targetname targetpath
cls
echo INSTALLING ----- %~1
echo CONTINUE? PRESS ANY KEY TO CONTINUE
Pause
start "" "D:\SCRIPT\SETUPS\%~2" || Exit /B 1
echo RETURNING...
timeout /t 2 > nul
Exit /B 0
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | T3RR0R |
