Google Answers Logo
View Question
 
Q: VBS to query registry ( No Answer,   1 Comment )
Question  
Subject: VBS to query registry
Category: Computers > Programming
Asked by: cdh99-ga
List Price: $10.00
Posted: 25 May 2004 14:36 PDT
Expires: 24 Jun 2004 14:36 PDT
Question ID: 351864
I need a relatively simple (I think - it's getting more complicated by
the minute ;) ) VBS script that does the following:

1. Queries machine name

2. Queries
[HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Windows Messaging Subsystem\Profiles\MS Exchange
Settings\0a0d020000000000c000000000000046]

Reads the data stored in value "001e0324" (the data will be in the
form pathname\file)

3. Queries filesize of the returned data

4. And then writes all of the queried information to CSV.  Such as:

Machinename,filename,sizeinbytes
BLAH123,c:\documents and settings\blah\blah\filename.pst,1234567

Gotchas:
#1:
It's possible the value 001e0324 won't exist.  If it doesn't
"NONE,NONE" should be listed for filename,sizeinbytes

#2:
In fact, it's possible the key won't exist - what do I mean by that?

Well, while the registry value is usually in this "generic" form:
[HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Windows Messaging Subsystem\Profiles\MS Exchange
Settings\0a0d020000000000c000000000000046]

It can also be in this user specific form:
[HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Firstname
Lastname\0a0d020000000000c000000000000046]

Therefore, I suspect what will need to happen is:
1. Enumerate:
[HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Windows Messaging Subsystem\Profiles\]

2. List value(s?) there (which would either be "MS Exchange Settings"
OR "Firstname Lastname" OR some other variation I haven't seen yet) -
but I suspect there will only be one (i.e. there won't be "MS Exchange
Settings" AND a "Firstname Lastname")

3. Query the \0a0d020000000000c000000000000046 below the appropriate value.
Answer  
There is no answer at this time.

Comments  
Subject: Re: VBS to query registry
From: crythias-ga on 06 Jun 2004 21:55 PDT
 
Take a look at http://www.robvanderwoude.com/index.html and see if it
helps. Specifically, the reg.exe page
http://www.robvanderwoude.com/ntregquery.html ...

(except... reg.exe won't parse remote HKCU, just HKU and HKLM...)

I like awk, particularly, so I'd parse the result... 

OTOH, you could put a batch script to have the individual computers
make this report for you....

Simply drop a .bat in the allusersdirectory\program files\startup of
each machine and have it do something like
regedit /e \\path\to\collectdir\%computername%.txt HKEY_LOCAL_MACHINE\blah\blah

then grep the information from *.txt to a file ....

so much easier with awk and grep...

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy