You are not logged in.
Pages: 1
At http://ss64.com/nt/rem.html, near the bottom, you state:
In Windows 2000 and XP a comment like
::%~
or
REM %~ will be interpreted giving the error:
The following usage of the path operator in batch-parameter substitution is invalid: %~
It should be noted that the error is fatal - all batch processing terminates when a REM like that "executes".
A similar fatal error also occurs if variable var is defined and you create a remark like the following:
rem %var:=
or
rem %var:*=
The problem is not limited to XP or Windows 2000.
I would classify the problem more as a design flaw than a bug, and it is an issue for all modern Windows versions that use CMD.EXE.
It is a result of the batch parsing rules used by CMD.EXE that jeb outlines at http://stackoverflow.com/a/4095133/1012053, coupled with the detailed % expansion rules that I outline at http://stackoverflow.com/a/7970912/1012053. In the Note 1 of that post, I discuss how REM is susceptible to the fatal error that can arise from invalid percent expansion.
Dave Benham
Last edited by dbenham (14 Jan 2016 04:55)
Offline
^ Thanks, I'll update this page over the weekend when I get time.
Offline
Pages: 1