Variable space
Posted: 20 Apr 2012 17:19
I am making this batch file like this:
:COMMANDPRO
set /p "command=C:\> "
if %command%==net user shutdown goto SHUTDOWN
echo Command not recognised...
goto COMMANDPRO
It doesn't work because I can't have any spaces in the IF statement. For it to work, I would have to type in netussershutdown but I want to type "net user shutdown"! Any ideas how I could make this work WITH spaces in the variable???
:COMMANDPRO
set /p "command=C:\> "
if %command%==net user shutdown goto SHUTDOWN
echo Command not recognised...
goto COMMANDPRO
It doesn't work because I can't have any spaces in the IF statement. For it to work, I would have to type in netussershutdown but I want to type "net user shutdown"! Any ideas how I could make this work WITH spaces in the variable???