Solved

parse information from reg query command

Posted on 2014-12-08
3
335 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

786 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