I’m unable to set the value of variable foo.The script is as follows:
@echo off
set foo = %1
echo %foo%
I’m getting this as an output:
ECHO is off
Can anyone tell me what am I doing wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Remove the spaces surrounding your equals sign:
EDIT (to elaborate):
You’re getting
ECHO is offbecause%foo%isn’t set to anything, so the command prompt only seesECHO.