Prince Etarnax
Prince Etarnax

Reputation: 1

Echoing a variable in Batch is not working?

I am currently trying to echo the text for a text based adventure game in Batch. My code looks like this:

...

    echo.
    echo Hello Adventurer.
    echo. 
    echo Please tell us your name:
    set /p pass =
    echo.

...

echo You will be searching for the Golden Egg %pass% . You are the des...

It's not working, can anyone help me out here?

Upvotes: 0

Views: 57

Answers (1)

Alex K.
Alex K.

Reputation: 175768

Remove the space around the =, i.e.

set /p pass=

(Currently your variable is actually called %pass %)

Upvotes: 3

Related Questions