Solved

parse information from reg query command

Posted on 2014-12-08
3
354 Views
Last Modified: 2014-12-08
Hey Experts.  When I run "reg query" on a remote pc from a batch script, I get so much information that I don't need in my log file.

HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\shareddlls
    C:\Windows\system32\vfpodbc.dll    REG_DWORD    0x1
    C:\Windows\system32\FM20ENU.DLL    REG_DWORD    0x2
    C:\Program Files\Common Files\Microsoft Shared\INK\INKDIV.DLL    REG_DWORD    0x2
    C:\Program Files\Common Files\Microsoft Shared\Ink\rtscom.dll    REG_DWORD    0x2
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\win\CP1252.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\win\CP1258.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\win\CP1257.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\win\CP1254.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\win\CP1253.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\win\CP1251.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\win\CP1250.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\Mac\SYMBOL.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\Adobe\zdingbat.txt    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\Adobe\symbol.txt    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\Mac\ROMAN.TXT    REG_DWORD    0x1
    C:\Program Files\Adobe\Reader 10.0\Resource\TypeSupport\Unicode\Mappings\Mac\CORPCHAR.TXT    REG_DWORD    0x1

Open in new window


How do I code the script so that the information I don't need is parsed out?  Such as, if I wanted only a couple of entries listed instead of lines of information.  

C:\Windows\system32\comcat.dll    REG_DWORD    0x3
C:\Windows\system32\comdlg32.ocx    REG_DWORD    0x2

Thanks for your help
0
Comment
Question by:samiam41
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 40487416
That's fairly easy if the files don't have spaces in them; just create a space separated list and pipe the reg.exe output to findstr,exe:
@echo off
setlocal
set DllList=\msvcp100.dll \msvcr100.dll
reg.exe query HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\shareddlls | findstr "%DllList%"

Open in new window

0
 
LVL 9

Author Closing Comment

by:samiam41
ID: 40487455
You are amaZing!!

Thanks!
0
 
LVL 9

Author Comment

by:samiam41
ID: 40487537
0

Featured Post

SendBlaster Pro 4 - Bulk Email Sending Software

SendBlaster 4 Pro - Best Bulk Emailing Sending Software
Automatic Subscribe / Unsubscribe Processing
Great for Newsletters & Mass Mailings
Optional HTML & Text Composition
Integration with Google Features
Built in Spam Score Checking
Free Professional Templates - Feature Packed!

Question has a verified solution.

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

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

739 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