I am struggling with a simple check if the user input was just empty (Enter) and in case set the variable to a new value... spend an hour but it does not work. Goal is to have the entered Value beginning with a backslash OR just an empty string if nothing was entered.
Code:
SET myTargetServerInstanceName=anyNOPEdummyValue
SET /P myTargetServerInstanceName=Enter Target Server INSTANCE Name:
IF %myTargetServerInstanceName%==anyNOPEdummyValue SET myTargetServerInstanceName=
IF NOT %myTargetServerInstanceName% == [] SET myTargetServerInstanceName=\%myTargetServerInstanceName%
this results in error:
SET was unexpected at this time.