0

I have spend lot of time but could not understand why entered value is showing blank in the echo command Here is the execution: Enter Name ssss Entered name is ""

Thanks for your help

@echo off
:Input_cname
  echo .
  set c_name=
  set /p c_name  =  Enter Name 
  echo Entered name is "%c_name%"
  if not defined c_name goto Input_cname
  if /i "%c_name:"=%" == "end" GOTO End
:End

1 Answer 1

1
@echo off
:Input_cname
  echo .
  set c_name=
  set /p c_name=  Enter Name 
  echo Entered name is "%c_name%"
  if not defined c_name goto Input_cname
  if /i "%c_name:"=%" == "end" GOTO End
:End

remove space before the equal sign because it will became part of the variable name.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.