Parse a registry query

March 19, 2009 at 06:53:40
Specs: Windows 2008
Hi guys. I am trying to retrieve a key value from the registry and then parse it so that all I get is the value it self. I haven't been able to get it working.

This is what I have so far:

FOR /F "tokens=3" %%i in ('reg query "HKCU\Volatile Environment" /v USERDNSDOMAIN') DO (echo %i)

Thanks guys.

See More: Parse a registry query

Report •

March 19, 2009 at 09:53:19
If the For /F is embedded in a batch script you need to code (echo %%i) not %i, on the contrary if the statement is entered at prompt the first %%i must be replaced by %i innstead.

That does not take into account the parse process itself.

Report •
Related Solutions

Ask Question