/build/static/layout/Breadcrumb_cap_w.png

need vbs to check for registry path/key exists

Hello all,

i need a vbscript that should run against all the machines in my network we are using sccm and check for a registry path/key and result should be written to excel file with the host name and result of search. Let me also know if i can do this in SCCM in any other way.

thanks in advance

0 Comments   [ + ] Show comments

Answers (5)

Posted by: andys0123 12 years ago
Orange Senior Belt
1
Create a VBScript using the RegRead function of a Shell object to check for the registry key/value and which writes to a CSV formatted TextFile using a FileSystemObject.

Using RegRead, if you are checking for a key, add a "\" at the end of the key path e.g. 'strVal = oShell.regread("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\")' . Check the value of the error returned - it will be >0 for a non valid key/value (remember the 'on error resume next' at the start of the script).

For the log, start each line with 'CHR(34) & ' to start with a double quote, and then add ' & CHR(34) & "," & CHR(34)' between each column to add the delimiters, End with ' & CHR(34) '. The file should the open in Excel with each column

Call the script from an advertised programm in SCCM and link to collection with all machines required.
Posted by: anonymous_9363 12 years ago
Red Belt
1
If you're expecting someone to post a script for you to use, I'd say you're straight out of luck. Building a script to do this job with any resilience is a non-trivial undertaking and most people who respond to posts work full-time. I wouldnt imagine any of them will provide you with code for free.

My advice would be to find a script which reads the registry value in question, find another which shows you how to programmatically populate an Excel spreadsheet and then marry the two together. Search AppDeploy for the text 'computerperformance'. That will turn up a number of posts with links to various web sites with scripts available for download.
Posted by: mahendraKumar 12 years ago
Senior Yellow Belt
0
what you want to check in Machines.. Please be more detailed on your needs..

whether it is HKCU or HKLM regkeys
whether you are going to generate report on applications installed in the target machines...
Posted by: acbabu 12 years ago
Orange Belt
0
Mahendra i am looking for HKLM reg key which is for internal use and every user should need that key so checking out for a script which looks in to each machine for the regpath and reports the results as yes/no
ORIGINAL: mahendraKumar

what you want to check in Machines.. Please be more detailed on your needs..

whether it is HKCU or HKLM regkeys
whether you are going to generate report on applications installed in the target machines...

Posted by: acbabu 12 years ago
Orange Belt
0
Thanks Andy i am trying out writing the script

ORIGINAL: andys0123

Create a VBScript using the RegRead function of a Shell object to check for the registry key/value and which writes to a CSV formatted TextFile using a FileSystemObject.

Using RegRead, if you are checking for a key, add a "\" at the end of the key path e.g. 'strVal = oShell.regread("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CTF\")' . Check the value of the error returned - it will be >0 for a non valid key/value (remember the 'on error resume next' at the start of the script).

For the log, start each line with 'CHR(34) & ' to start with a double quote, and then add ' & CHR(34) & "," & CHR(34)' between each column to add the delimiters, End with ' & CHR(34) '. The file should the open in Excel with each column

Call the script from an advertised programm in SCCM and link to collection with all machines required.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ