Computing.Net > Forums > Programming > Parse a registry query

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Parse a registry query

Reply to Message Icon

Name: Machiavelli
Date: March 19, 2009 at 06:53:40 Pacific
OS: Windows 2008
Subcategory: Batch
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: March 19, 2009 at 09:53:19 Pacific
Reply:

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.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Parse a registry query

delete a registry key with batch? www.computing.net/answers/programming/delete-a-registry-key-with-batch/8218.html

Create a registry backup with batch www.computing.net/answers/programming/create-a-registry-backup-with-batch/8549.html

Save a registry key value in a var www.computing.net/answers/programming/save-a-registry-key-value-in-a-var/9275.html