Choosing a variable's value or ''word'' [help]

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jaxx
Posts: 2
Joined: 15 Mar 2014 12:34

Choosing a variable's value or ''word'' [help]

#1 Post by jaxx » 15 Mar 2014 12:44

Hello!

Im new to using Batch commands and im wondering how to set a variable When i've executed the batch. For example.. You start the program, and then you get to choose the variable's value or word.

I want to be able to use this as normal, as if i've used ''set var=example'' and %var% = example.

Sorry bout the bad english.

aGerman
Expert
Posts: 4744
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Choosing a variable's value or ''word'' [help]

#2 Post by aGerman » 15 Mar 2014 17:34

I'm not quite certain what you are looking for. Maybe SET /P :?

Code: Select all

set /p "var=Enter the value: "
echo You entered %var%


Regards
aGerman

jaxx
Posts: 2
Joined: 15 Mar 2014 12:34

Re: Choosing a variable's value or ''word'' [help]

#3 Post by jaxx » 15 Mar 2014 20:01

Thank you!

I'd like it to open X instances with a code aswell. Like opening 10 instances with ipconfig as a command. right now im using:

:choice1
START x.bat
START x.bat
START x.bat
START x.bat
START....

I'd like it to be only 1 bat file instead of 2.

Thanks again! :)

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Choosing a variable's value or ''word'' [help]

#4 Post by foxidrive » 16 Mar 2014 00:19

Tell us exactly what you need - batch files often change quite markedly with small differences in the task.

Post Reply