jeb wrote:But I know how to access it
Code: Select all
setlocal DisableExtensions
echo %=::%
I didn't found a way to modify the value (always ::\ )
Did I get you
Did you test
Here is what I get on my machine from an interactive prompt:
This is what I get on my machine within a batch:
Results:
The only way I see the ::\ value is through SET "" (interactive or batch):
Code: Select all
C:\test>set "" | findstr /b =:
=::=::\
It gets weirder than that. I think the values I am seeing via ECHO are related to the results of substring or replacement operations on an undefined variable. It doesn't seem to matter what characters I place before the :, it always echoes the characters appearing after the colon.
Code: Select all
@echo off
echo %=:hello world%
echo %!^^^&^<^>\/():after colon%
echo %undefined:~0,5%
echo %undefined:a=b%
Results:
I tried the above experiments with delayed expansion, with the same results. It doesn't seem like the =:: variable is real. So why does it show up with SET ""
---------------------
Returning to the original theme of this thread (sort of). I think I have another case where replacement (and substring) is problematic. I don't think it is possible to perform substring or replacement on a variable if the name ends with a colon (:) . This has an impact on the =C:, =D: etc. variables.
--------------------
Just an observation - It seems very odd that normal dynamic variables (ERRORLEVEL, TIME, RANDOM etc) never show up in SET command, but do test as defined (IF DEFINED ERRORLEVEL is true). But the = dynamic variables do show up in SET "" command, but test as undefined (IF DEFINED =C: is false)
Dave Benham