PowerShell 脚本,用于比较两个注册表文件 A.reg 和 B.reg,
并将相同部分保存为 AB相同.reg,
A.reg 的独有部分保存为 A独有.reg,
B.reg 的独有部分保存为 B独有.reg,
A.reg 的差异部分保存为 A差异.reg,
B.reg 的差异部分保存为 B差异.reg:
例如(实际情况比这多的多)
以下为A.reg- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM]
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001]
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\CI]
- "UMCIDisabled"=dword:00000000
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control]
- "BootDriverFlags"=dword:0000001c
- "CurrentUser"="USERNAME"
- "EarlyStartServices"=hex(7):52,00,70,00,63,00,53,00,73,00,00,00,50,00,6f,00,77,\
- 00,65,00,72,00,00,00,42,00,72,00,6f,00,6b,00,65,00,72,00,49,00,6e,00,66,00,\
- 72,00,61,00,73,00,74,00,72,00,75,00,63,00,74,00,75,00,72,00,65,00,00,00,53,\
- 00,79,00,73,00,74,00,65,00,6d,00,45,00,76,00,65,00,6e,00,74,00,73,00,42,00,\
- 72,00,6f,00,6b,00,65,00,72,00,00,00,44,00,63,00,6f,00,6d,00,4c,00,61,00,75,\
- 00,6e,00,63,00,68,00,00,00,52,00,70,00,63,00,45,00,70,00,4d,00,61,00,70,00,\
- 70,00,65,00,72,00,00,00,4c,00,53,00,4d,00,00,00,41,00,70,00,70,00,49,00,64,\
- 00,53,00,76,00,63,00,00,00,00,00
- "PreshutdownOrder"=hex(7):44,00,65,00,76,00,69,00,63,00,65,00,49,00,6e,00,73,\
- 00,74,00,61,00,6c,00,6c,00,00,00,55,00,73,00,6f,00,53,00,76,00,63,00,00,00,\
- 77,00,75,00,61,00,75,00,73,00,65,00,72,00,76,00,00,00,64,00,6f,00,73,00,76,\
- 00,63,00,00,00,67,00,70,00,73,00,76,00,63,00,00,00,74,00,72,00,75,00,73,00,\
- 74,00,65,00,64,00,69,00,6e,00,73,00,74,00,61,00,6c,00,6c,00,65,00,72,00,00,\
- 00,00,00
- "SystemBootDriveLetter"=dword:00000058
- "WaitToKillServiceTimeout"="5000"
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control\ACPI]
- "AMLIGlobalHeapSize"=dword:00100000
复制代码 以下为B.reg- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM]
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001]
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\CI]
- "UMCIDisabled"=dword:00000000
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control]
- "BootDriverFlags"=dword:0000001A
- "CurrentUser"="USERNAME"
- "WaitToKillService"="6000"
复制代码 比较后得到AB相同.reg- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM]
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001]
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\CI]
- "UMCIDisabled"=dword:00000000
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control]
- "CurrentUser"="USERNAME"
复制代码 A独有.reg- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control]
- "EarlyStartServices"=hex(7):52,00,70,00,63,00,53,00,73,00,00,00,50,00,6f,00,77,\
- 00,65,00,72,00,00,00,42,00,72,00,6f,00,6b,00,65,00,72,00,49,00,6e,00,66,00,\
- 72,00,61,00,73,00,74,00,72,00,75,00,63,00,74,00,75,00,72,00,65,00,00,00,53,\
- 00,79,00,73,00,74,00,65,00,6d,00,45,00,76,00,65,00,6e,00,74,00,73,00,42,00,\
- 72,00,6f,00,6b,00,65,00,72,00,00,00,44,00,63,00,6f,00,6d,00,4c,00,61,00,75,\
- 00,6e,00,63,00,68,00,00,00,52,00,70,00,63,00,45,00,70,00,4d,00,61,00,70,00,\
- 70,00,65,00,72,00,00,00,4c,00,53,00,4d,00,00,00,41,00,70,00,70,00,49,00,64,\
- 00,53,00,76,00,63,00,00,00,00,00
- "PreshutdownOrder"=hex(7):44,00,65,00,76,00,69,00,63,00,65,00,49,00,6e,00,73,\
- 00,74,00,61,00,6c,00,6c,00,00,00,55,00,73,00,6f,00,53,00,76,00,63,00,00,00,\
- 77,00,75,00,61,00,75,00,73,00,65,00,72,00,76,00,00,00,64,00,6f,00,73,00,76,\
- 00,63,00,00,00,67,00,70,00,73,00,76,00,63,00,00,00,74,00,72,00,75,00,73,00,\
- 74,00,65,00,64,00,69,00,6e,00,73,00,74,00,61,00,6c,00,6c,00,65,00,72,00,00,\
- 00,00,00
- "SystemBootDriveLetter"=dword:00000058
- "WaitToKillServiceTimeout"="5000"
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control\ACPI]
- "AMLIGlobalHeapSize"=dword:00100000
复制代码 B独有.reg- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control]
- "WaitToKillService"="6000"
复制代码 A差异.reg- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control]
- "BootDriverFlags"=dword:0000001c
复制代码 B差异.reg- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\PE_SYSTEM\ControlSet001\Control]
- "BootDriverFlags"=dword:0000001A
复制代码
|