dump2inf.vbs: Dump registry as *.inf file

dump2inf.vbs dumps a Windows registry into an *.inf file AddReg=section format. Useful for prototyping an *.inf file, or for taking diff(1) (fc.exe) against registry change.

Requirements: Windows 2000 or after

For Windows 2000, apply Hotfix KB817478 to dump HKEY_USERS properly.

$Id$


Downloads


Example

C:\>cscript //nologo .\dump2inf.vbs "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
[Version]
Signature = "$Windows NT$"

[DefaultInstall]
AddReg = section.addreg

[section.addreg]
HKCU,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon",BuildNumber,65537, 7601
HKCU,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon",ExcludeProfileDirs,,"AppData\Local;AppData\LocalLow;$Recycle.Bin"
HKCU,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon",FirstLogon,65537, 0
HKCU,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon",ParseAutoexec,,1

Synopsis

C:\>cscript .\dump2inf.vbs /?
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Usage:
cscript //nologo //U dump2inf.vbs [-b 32][-s 16384] HKLM\SOFTWARE ... > output.inf
cscript //nologo dump2inf.vbs [-b 32][-s 16384] -u -o output.inf HKLM\SOFTWARE ....
  -o file.inf   Output to file.inf instead of stdout
  -u            Output the -o file in Unicode mode
  -s 16384      Maximum REG_BINARY size to dump
  -b 32         Maximum bytes in a line for REG_BINARY dump

Example: Dump the whole HKEY_CURRENT_USER in ANSI text file hkcu.inf:
cscript //nologo dump2inf.vbs HKCU > hkcu.inf

Example: Dump HKEY_LOCAL_MACHINE\Software in UTF16 to SOFTWARE.INF:
cscript //nologo dump2inf.vbs -u -o SOFTWARE.INF HKLM\Software

Caveats


kabe.sra-tohoku.co.jp