) remcolon 1
) if 1. == . goto nobad0
The following usage of the path operator in batch-parameter
substitution is invalid: %~C echoes percents and value of path
For valid formats type CALL /? or FOR /?
The syntax of the command is incorrect.
) :: Doubling C in ("a;%path%;b) do echo %C in ("a;%%path%%;b) do echo %~C echoes percents and value of path
) remcolon
) if . == . goto nobad0
The following usage of the path operator in batch-parameter
substitution is invalid: %~C echoes percents and value of path
For valid formats type CALL /? or FOR /?
:nobad0
was unexpected at this time.
) rem Doubling C in ("a;%path%;b) do echo %C in ("a;%%path%%;b) do echo %~C echoes percents and value of path
)
>
--
Walter Briscoe
^ :: Doubling % fails. Interactively, for %C in ("a;%%path%%;b) do echo %~C
echoes percents and value of path
^ rem Doubling % fails. Interactively, for %C in ("a;%%path%%;b) do echo
%~C echoes percents and value of path
After a quick look I'd say that the problem is triggered by the appearance of
the single percent sign in "Doubling % fails." In NT, variable names can
contain spaces.
A colon indicates a label and labels may consist of variables, so the
variable name "% fails. Interactively, for %" is being expanded to an empty
string.
Frank
While Win2000 incorrectly tries to perform a substitution on lines such as
rem %~C
Win9x is not squeaky clean either. The following line will create an empty
file test.txt even though it should not:
rem xcopy *.* d:\ >test.txt
The following line of code is another irritating trap:
if exist %temp%\semaphore.txt del %temp%semaphore.txt
if not "%1"=="" echo.>%temp%\semaphore.txt
if exist %temp%\semaphore.txt echo A parameter was passed!
You will find that semaphore.txt always exists, regardless of the existence
of a parameter!