Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $regBaseline = "baseline"
- $destPath = "C:\Users\Student\Documents\Registry\"
- $ErrorActionPreference = "SilentlyContinue"
- $ErrorActionPreference = "Continue"
- $registryKeys = @(
- "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
- "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx"
- "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx"
- )
- $hLine = "-"*75
- $ErrorActionPreference = "SilentlyContinue"
- foreach($key in $registryKeys){
- $keyIndex = $registryKeys.IndexOf($key)
- Write-Host "`n$hLine`nDIFFERENCES IN $key`n$hLine"
- if(!(Reg export $key "$destPath$keyIndex")){"error"}
- }
- $ErrorActionPreference = "Continue"
- Remove-Item "$destPath$keyIndex"
- Compare-Object (gc $destPath1) (gc $destPath2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement