So this is probably waaaaaay late to the party but the actual problem is an error or rather the repetition of the same error in three batch files.
C:\Program Files(x86)\Microsoft Visual Studio 10.0\Common7\Tools\VCVarsQueryRegistry.bat
C:\Program Files(x86)\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat
C:\Program Files(x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat
The pattern of the error is everywhere a for loop is used to loop through registry values. It looks like this:
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO (
@if "%%i"=="10.0" (
@SET "VS100COMNTOOLS=%%k"
)
)
The problem is the second occurrence of %%i. The way the loop construct works is the first %% variable is the first token, the next is the second and so on. So the second %%i should be a %%j (or whatever you want) so that it points to the value that would possibly be a "10.0". You can tell the developer wanted to use i,j,k as the values because in the enclosed @SET in the if, they use %%k. Which would be the path.
So, in short, go through all these types of loops in the three files above and change the second occurrence of %%i to %%k and everything will work like it's supposed to. So it should look like this:
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO (
@if "%%j"=="10.0" (
@SET "VS100COMNTOOLS=%%k"
)
)
Hope this helps. Not sure if this applies to all versions. I only know that it does apply to VS 2010 (SP1).