• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

Extracting Software Display Name and Display Version from a .reg file

Hey guys,

I need a tiny tool to help parse 2 strings from a .reg file  – should be fairly easy J


The script will open the .reg file  and for every Instance of:


Extract data from the following headers:

·      Display Name
·      Display Version

Present the output it in a comma deliminated or .xls output.


Sample input (sample.reg)
"DisplayName"="Security Update for CAPICOM (KB931906)"

"UninstallString"="\"C:\\Program Files\\InstallShield Installation Information\\{3C4DF0FD-95CF-4F7B-A816-97CEF616948F}\\setup.exe\""
"LogFile"="C:\\Program Files\\InstallShield Installation Information\\{3C4DF0FD-95CF-4F7B-A816-97CEF616948F}\\setup.ilg"
"InstallSource"="C:\\HP Mgmt\\sysmgmt\\Setup.exe"
"DisplayName"="HP System Management Homepage"
"Publisher"="Hewlett-Packard Company"
"RegCompany"="Invenergy LLC"

Sample output (sample.xls)

Software                                                Version
Security Update for CAPICOM      
HP System Management Homepage      2.1.14

1 Solution
Please check the below listed script. It creates a csv file which can easily opened with excel
set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile("D:\test.reg")
set objOutput = objFSO.CreateTextFile("D:\Output.csv")

Do while not objFile.AtEndOfStream
	strCurrentLine = objFile.ReadLine
	If Instr(strCurrentLine,"DisplayName") then
		strName = Replace(Split(strCurrentLine,"=")(1),chr(34),"")
	End if
	If Instr(strCurrentLine,"DisplayVersion") then
		strVersion = Replace(Split(strCurrentLine,"=")(1),chr(34),"")
		objOutput.WriteLine strName &";" &strVersion
	End if

Open in new window

NanohurtzChromeAuthor Commented:
A credit to the title of "Guru" Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now