Solved

Run a script to find a registry entry on remote computers?

Posted on 2008-10-20
8
726 Views
Last Modified: 2012-05-05
Greetings Experts!

I have a 200+ Windows XP/2003 AD domain in which I recently used a group policy to install Adobe Active-x player on the users pc's.  After running an inventory update on SpiceWorks, only 53 of the 200 show up as having the software installed.  Yet I have verified at least 5 others that have the software installed and are not showing up in SW.

So, I want to run a script that will find the app code {AC76BA86-7AD7-1033-7B44-A9000000000} in the registry of the computers listed in a text file.  The problem is, I have no idea how to make this happen.  My scripting skills are novice at best so if you post a suggestion, please provide it with some help or be willing to answer some newb questions.

Thanks in advance!
0
Comment
Question by:samiam41
  • 5
  • 2
8 Comments
 
LVL 8

Expert Comment

by:DenverRick
ID: 22759102
You would probably have to buy one of the many utilities available for registry work...or you could create a script in Group Policy that runs at logon, that uses the reg command to query the local registry and port the results to a file (on a server) named with the local machine name.
0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 total points
ID: 22759414
Paste the script below into a text file with a .cmd extension.  Customize the value of the key variable with the location of the registry key to check for.  Running the script will check for the existence of the key on all computers in computerlist.txt and output the results to log.csv.


@echo off

setlocal
 

set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A9000000000}

set log=log.csv
 

for /F %%G in (computerlist.txt) do (

 reg query "\\%%G\%key%" > NUL 2>&1

 if errorlevel 1 (echo %%G,no>>"%log%") else (echo %%G,yes>>"%log%")

)

Open in new window

0
 
LVL 9

Author Comment

by:samiam41
ID: 22759574
Thanks for the posts.

@ Shift-3 >  That is what I was looking for.  I will test it out now and let you know the results.
0
 
LVL 9

Author Comment

by:samiam41
ID: 22759946
How do I specify where the computerlist.txt file is located or where does the script believe it should be located?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 9

Author Comment

by:samiam41
ID: 22759972
never mind.  I figured it out.  Thanks
0
 
LVL 9

Author Comment

by:samiam41
ID: 22759991
DUDE!!  That is seriously one of the COOLEST scripts I have seen.  Maybe I am just easily amazed but man that makes it easy to use and understand the results.  YES!  

Can I modify that to detect other apps as long as I change the app code??
0
 
LVL 38

Expert Comment

by:Shift-3
ID: 22760230
Yes, just change the value of the key variable.
0
 
LVL 9

Author Closing Comment

by:samiam41
ID: 31507867
I know that must have been painfully easy for you but your answer proved invaluable for me.  Thanks again for your help.

Regards,
Aaron
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now