Hi,
I am new the the forum as well as being new to batch scripting and I am looking for an answer on the best way of passing in user input to a command.
So the menu needs to ask the user to input a filename, then I need that result passed into the code below, the result will be the "end user" naming there own file to whatever they want and the process taking place. This takes place of me statically naming the file to what I want, the user can name it to what they want, then the rest of the process takes place and they have there own named file.
Any assistance and or example on the best way of doing this would be great, thanks in advance.
Sebastian.
Interactive Menu with user Input
Moderator: DosItHelp
-
- Posts: 82
- Joined: 30 Dec 2013 10:16
- Location: United States by the big waterfall
Re: Interactive Menu with user Input
Open up a cmd prompt and type set /? pay particular attention to the /p switch. This allows your script to take input while it's running.
Re: Interactive Menu with user Input
Matt,
Thanks for the reply, I have been working though this. My next question would be if the user put in a response to my question by me using the
below.
set /p Var1= " "
How then would I pass this response to another part of the batch file to then my ultimate command would get executed all based on the users input to the above, or would my VAR1 "" be totally inaccurate?
Thanks for the help!
Thanks for the reply, I have been working though this. My next question would be if the user put in a response to my question by me using the
below.
set /p Var1= " "
How then would I pass this response to another part of the batch file to then my ultimate command would get executed all based on the users input to the above, or would my VAR1 "" be totally inaccurate?
Thanks for the help!
Re: Interactive Menu with user Input
I answered my own question and took care of this.. Thanks