Solved

parse information from reg query command

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

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

Suggested Solutions

Title # Comments Views Activity
No module found pypyodbc, 3 33
How to remove unwanted words? 34 50
Exclude all *.dat files from a 7z.exe command line 13 18
Windows Installer (VBSCRIPT) Rename Printer 3 31
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
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.

820 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