Solved

parse information from reg query command

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 7 Temporary Profile 4 69
EaseUS Todo back-up doing multiple versions? 8 36
Hyper-V not working after Anniversary Update 7 50
Malware Exploit 5 80
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

911 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

25 Experts available now in Live!

Get 1:1 Help Now