I need to use a REG QUERY command to view the value of a key and set the result into a variable with this command:
FOR /F \"tokens=2* delims= \" %%A IN (\
For Windows 7 (Professional, 64-bit - can't speak for the others) I see that REG no longer spits out
! REG.EXE VERSION 3.0
as it does in XP. So the above needs to be modified to use
skip=2
instead of 4 - which makes things messy if you want your script to be portable. Although it's much more heavyweight and complex, a WMIC based solution may be better.