Check if registry contains data from .reg file

2

1

I have .reg file which was exported on another PC and contains some keys, values and data from different parts of registry.

How to check if this keys, values and data are already present on my PC ?

Is there a script or program which could take my .reg file as input and then tell me which of this keys, values and data are already present on my PC ?

EDIT: I'm not asking how to compare two .reg files. But I have a .reg file with some keys, values and data and I want to check if this keys, values and data are present in the registry on another PC. I cannot export the same file on another PC and compare because the keys, values and data are not under the same key but are coming from different parts of registry.

Johan Bernardic

Posted 2018-07-17T06:18:49.487

Reputation: 21

Export the same section(s) from your PC's registry and compare 2 files using any software. – Akina – 2018-07-17T06:28:44.677

@Akina thanks for your comment, already tried with this method, but not always the most precise one, specially if you have multiple .reg files or one .reg file with multiple keys from different parts of registry exported... – Johan Bernardic – 2018-07-17T06:33:38.173

I usually use Excel - import 1st file to column A and 2nd to column B, remove blank cells and use conditional formatting for coloring differences. If some diff, add cells over against the data present in ajacent column and absent in current. – Akina – 2018-07-17T06:35:33.983

Use Notepad++ Compare plugin, this gives side by side comparison with features like difference highlighting. – pun – 2018-07-17T06:44:55.137

Thanks for comments, but I tried already Notepad++ Compare and this is not helpful in my case. Because I have several different keys exported from different part of registry. – Johan Bernardic – 2018-07-17T06:48:56.743

1In that case the best you can do is, write registry key values you are looking for in your computer and then parse registry file to see if it contains it. – pun – 2018-07-17T08:11:12.003

Answers

1

There isn't a straight way to do this.

But if you are dealing with multiple .reg files (more than 2 or 3) or more than one computer, you could use the approach below.

  1. Read registry Key/Value from your computer into variable or multiple variables using Get-ItemProperty or Get-ItemPropertyValue
  2. Read contents of exported .reg files in another variable using Get-Content
  3. Now you can use PowerShell comparison operators to see if exported .reg files contain Key/Value from your computer.

pun

Posted 2018-07-17T06:18:49.487

Reputation: 5 311