When I use SET with spaces in the text I receive an error message. Why? Note: this call is inside of another function, I am using setlocal enabledelayedexpansion set at beginning of file.
This works with no error (no spaces in SET text):
:: Is the host up?
CALL :TEST_HOST_UP %REMOTE_SYSTEM%
IF %ERRORLEVEL% NEQ 0 (
set "RETVAL=Error_Unable_To_Reach_Host"
GOTO :FINISHED
)
Causes an error "was unexpected at this time":
:: Is the host up?
CALL :TEST_HOST_UP %REMOTE_SYSTEM%
IF %ERRORLEVEL% NEQ 0 (
set "RETVAL=Error Unable To Reach Host"
GOTO :FINISHED
)