What did I do to screw up my CMD shell? Windows XP Pro, open a cmd window and do:
C:\>set tt = name C:\>set tt tt = name C:\>echo %tt% %tt% C:\>echo %time% 14:13:28.67
The echo command doesn't work for some reason. I can echo the built-in variables just fine. Tried it on another computer and that works as expected
To reference a variable in Windows, use %varname% (with prefix and suffix of '%' ). For example, you can use the echo command to print the value of a variable in the form " echo %varname% ".
To display the command prompt, type echo on. If used in a batch file, echo on and echo off don't affect the setting at the command prompt. To prevent echoing a particular command in a batch file, insert an @ sign in front of the command.
Please open a command prompt window, run set /? and read the output help. The syntax is set /P variable=prompt text or better set /P "password=Enter your password: " . And please note that variable password keeps its current value if already defined and user hits just RETURN or ENTER.
Echo is an internal command that is available in the following Microsoft operating systems.
The set
command does not take spaces. The proper syntax would be:
set tt=name
What you have done in your example is set an environment variable tt<space>
. With that in mind, you can try this:
echo %tt%
and see your output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With