Why "ECHO is off" is printed?

1563 views batch-file

I am expecting to receive just an output "NO User exists for *" after running this code:

FOR /F "tokens=* delims= " %%A IN ('C:\windows\System32\query.exe user /server:<some_IP_address>') DO SET NumDoc1=%%A
echo %NumDoc1%

But I keep getting:

No User exists for * 
ECHO is off.

How do I get rid of "ECHO is off" from my output?


answered question

Must mean your environment variable is blank.

1 Answer


You are echoing the current echo status because your variable is empty.

Try this instead:

echo NumDoc1:%NumDoc1%

posted this

Have an answer?


Please login first before posting an answer.