Nice template, should come in handy. Hi, I am new to bat script. My scenario is I need to 1. Select User Agent 4. You can even use mouse input to select the menu options. I like this a lot as well A question though, since I'm new to batch scripts; Say I wanted to put this onto a flash drive. Every computer is going to assign a flash drive a letter when it is plugged in, but that letter isn't always the same. How could you ask for a letter from the user and then assign that input as part of the path for the "selections" on lines 52, 56, 60, etc?
This program was very helpful. Thank you so much for posting this. The structure made things very easy to follow and tweak! Echo Getting package list Package to remove or Q to quit: " Echo. Great Template. Only issue I had with it was when selecting one of the menu items it would automatically continue with the menu items below that number.
You Might Also Like How to. How to. About This Article. Tested by:. Co-authors: Updated: April 2, Categories: Programming. Thanks to all authors for creating a page that has been read , times. Is this article up to date? Cookies make wikiHow better. By continuing to use our site, you agree to our cookie policy. Featured Articles How to. Trending Articles How to. New Pages How to. Watch Articles How to. Categories Computers and Electronics Software Programming.
By signing up you are agreeing to receive emails according to our privacy policy. Follow Us. We've got the tips you need Subscribe You're all set! Connect and share knowledge within a single location that is structured and easy to search. And when user Select option 6, it will install all Applications! This will do what you want. Let me know if you have any questions. All you have to do is follow the two steps listed in the script.
Getting user input can be found here: How to read input from console in a batch file? The installing of applications is a little more complex - you need to know the requirements of your apps and where files should be moved - that should be simple, as well; use move on the appropriate files in the appropriate place. The for One feature that they have left out is selecting all the software it installs in one go so to speak. So I made this off the top of my head extremely sorry if there is something wrong with it, I'll edit it if there is.
What the code is doing is getting the user input such as if you put in "1,3,4" , putting each number into its own variable, checking if that variable is empty, and if it isn't, sending you to code that does whatever the option was. It does this a few times until all the variables have been assessed. This is a proposed analysis for improvement on David Ruhmann's code relating to the "Validate Input" section above:. When each are submitted for input the program closes.
Another great tutorial for batch menus is found here. The code sets the variable AppInstaller to 1, 2, or 3. The file determines this and redirects you to an installer for each one. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Multiple choices menu on batch file? Ask Question. Asked 8 years, 11 months ago. Active 2 years, 11 months ago.
Viewed 68k times.
0コメント