So I recently started learning making .bat file and I'm asked to make a guessing game. my variable is some why being set with a space after the name, any ideas?
@echo off
set /A number=%random%
echo type your guess
set /P /a guess=
set guess
So I recently started learning making .bat file and I'm asked to make a guessing game. my variable is some why being set with a space after the name, any ideas?
@echo off
set /A number=%random%
echo type your guess
set /P /a guess=
set guess
You cannot use /a
and /p
together. Batch sets a variable called /a guess
to the value received.