|It's really hard to answer most of these, because your asking why on most of them, the only people that would really know why are the people that programmed the cmd/batch environment.... |
Most of these are guesses based on my observations, but I think all of it could be attributed to a complex or multiple depth command parsing.
I'm not sure, but it can be quite useful to have empty variables in scripts at times. Especially when making commands up from variables.
My guess on this one is that "%windir^%" is being expanded to a empty variable and the first caret is escaping the new line.
echo the caret can also escape a ^
The carets do indeed seem to be the only way to escape the %'s on the command line......
My guess would be to differentiate between parameters %1 and for variables(which can be %%1, but are normally letters).
echo Exclamation mark visible here: ^^!
It's important to remember that cmd tries to be backwards compatible with most stuff back to DOS, but with some new bits and pieces added on. So it could be as simple as it's how it was done in DOS and they didn't want to break compatibility...