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

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NanohurtzChromeAuthor Commented:
A credit to the title of "Guru" Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.