Page 1 of 1

User input and variable? How?

Posted: 02 Apr 2017 00:16
by Tami
So, here's my problem:

I want to ask in which language they need it. So they must decide between de, en, es and fr. How do i do that?
If they type in "de", then the %variable1% should be de. If they type in "en", then the %variable1% should be en.
Thanks!

Re: User input and variable? How?

Posted: 02 Apr 2017 04:18
by aGerman
SET /P is what you're looking for.

Code: Select all

set /p "variable1=Enter the language [de, en, es, fr]: "

Steffen

Re: User input and variable? How?

Posted: 07 Apr 2017 09:05
by UppityGaming
Well you could make separate sections in an array and use the following code
set en ==1 set fr==2
if %cho%==1 goto English
if %cho%==2 goto french

Re: User input and variable? How?

Posted: 07 Apr 2017 11:46
by aGerman
That's the wrong syntax for SET. Also I don't see where the value for %cho% is coming from.

Steffen