Solved

parse information from reg query command

Posted on 2014-12-08
3
327 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
  • 2
3 Comments
 
LVL 83

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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 …
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

747 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