There is nothing wrong with this command right ?
place it on top of your batch and you'll see it works perfectly.
Code: Select all
echo.path=%path%_
for /f ^"usebackq^ eol^=^
^ delims^=^" %%! in ( '"path WIN32_PRODUCT get Caption", 0, $Products' ) do echo.ok
Now let's assign some variables, lets make sure CMD uses at least 10.000kb of memory.
Let's call very deep into our functions lets say 3 levels deep.
Now the weird part, this is what cmd tells me after yet another call which brings us 4 levels deep.
Now I execute the above command again, and guess what DOS tells me:
popupWindow: 'CMD.EXE'
Code: Select all
Please insert disk into drive A:
Then I change 'path WIN32_PRODUCT' -> '#path WIN32_PRODUCT'
And ofcourse the command works again.
But why ?
I've been figuring this one out for 4 hours now, did I forgot an endlocal somewhere ? did I used goto :eof where I shouldn't have, is the memory full ? Is there some kind of maximum allocatable memory in DOS (my script sometimes uses up to an amazing 17MB of memory) ?
Can't figure it out

PS: some claim: "%%~a.^!%%~a^!" will work in macros, well on XP it gives the file attributes:
name.------a--
in macros it only works without the tilde "%%~a.^!%%a^!" gives:
name.value
This means %%a can never be quoted !
What is really strange is that on XP starting from %%b the tilde variant suddenly works again

This is why in the past, I always started a for with %%b as first token.