A.D. Fundum
2015-12-22 11:14:25 UTC
I'm trying to avoid the use of Rexx. Is there a way to detect an empty
argument in CMD files, which supports any valid long file name syntax?
This TEST.CMD won't work if the argument is "Test:
REM This is TEST.CMD
IF '%1'=='' GOTO End
CD %1
:End
[R:\]IF '"Test'=='' GOTO End
SYS1003: The syntax of the command is incorrect.
This should work (i.e. is a valid syntax), hence the use of a single
":
CD "Test
I assume that it's a missing CMD.EXE feature, but perhaps there's a
trick. Both Test and "Test" will work, but "Test won't. I've already
tried different characters, including <ESC> instead of quote
characters.
--
argument in CMD files, which supports any valid long file name syntax?
This TEST.CMD won't work if the argument is "Test:
REM This is TEST.CMD
IF '%1'=='' GOTO End
CD %1
:End
[R:\]IF '"Test'=='' GOTO End
SYS1003: The syntax of the command is incorrect.
This should work (i.e. is a valid syntax), hence the use of a single
":
CD "Test
I assume that it's a missing CMD.EXE feature, but perhaps there's a
trick. Both Test and "Test" will work, but "Test won't. I've already
tried different characters, including <ESC> instead of quote
characters.
--