Oops, how about this...
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "%RegKeyPath%" /v 9.0 2^>NUL') DO SET VCRoot=%%B
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "%VSRegKeyPath%" /v 9.0 2^>NUL') DO SET VSRoot=%%B
On Thu, Jan 8, 2009 at 2:39 PM, Glenn Carr <glenn@...> wrote:
I'd always noticed that setenv cleared the screen, but I never took the time to figure out why...:: Read the value for VCRoot and VSRoot from the registry.
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "%RegKeyPath%" /v 9.0') DO SET VCRoot=%%B
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "%VSRegKeyPath%" /v 9.0') DO SET VSRoot=%%B:: Hide the error output from the call to 'REG' since VCRoot and VSRoot have already been set
:: to a default value.
CLSMight be nicer to actually redirect the output...:: Read the value for VCRoot and VSRoot from the registry.
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "%RegKeyPath%" /v 9.0 ^>NUL 2^>^&1') DO SET VCRoot=%%B
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "%VSRegKeyPath%" /v 9.0 ^>NUL 2^>^&1') DO SET VSRoot=%%B...and less annoying when you're invoking setenv from an existing cmd shell...