[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[注册表类] [源码]Reg2Inf v0.46 注册表转换inf

作者:n7Epsilon
出处:https://ryanvm.net/forum/viewtopic.php?t=2169
下载:http://cid-704054d7328ec826.skyd ... Reg2Inf%5E_0.46.zip
md5: 303E74C60C5D138FE0AB6611C1F6ABB4(未解压)
http://bcn.bathome.net/s/tool/index.html?key=Reg2Inf

C#,基于.NET2.0,完全用正则式转换。

支持:
- REG_SZ, REG_DWORD, REG_DWORD_BIG_ENDIAN, REG_LINK, REG_EXPAND_SZ, REG_MULTI_SZ, REG_BINARY, REG_QWORD, REG_FULL_RESOURCE_DESCRIPTOR, REG_RESOURCE_REQUIREMENTS_LIST and REG_NONE.
- AddReg 和 DelReg

手册:
  1.        A program to convert registry information from Windows Registry
  2.        format (.REG) to standard Windows INF format (.INF).
  3. ** Usage:
  4. * Reg2Inf "Tweaks.REG"|@"List.txt" (["Tweaks.INF"]|[/linesonly]) [/RepVars]
  5.    [/UseStrings] [/forceascii] [/longflags]
  6. - List file should contain paths to REG files to merge and convert.
  7. - /RepVars: Look for some values (eg: "C:\Program Files") and replace with
  8.    equivalent INF-specific variables (eg: %16422%). <EXPERIMENTAL>
  9. - /linesonly: Output INF format registry lines without writing a generic INF.
  10. - /UseStrings: Generate [Strings] section and use INF variables in subkeys.
  11. - /forceascii: Saves the output INF in ANSI system codepage instead of Unicode
  12. - /longflags: Makes the output INF use fully qualified hexadecimal flags,
  13.    to be compatible with Windows setup textmode parser.
复制代码
范例:
  1. @echo off
  2. pushd "%~dp0"
  3. for %%a in (*.reg) do (
  4. if "%%~na" neq "" Reg2Inf.exe "%%~na.reg" "%%~na.inf"
  5. )
  6. pause
复制代码
缺点:
2006年开发的工具,还没普及64bit系统,或者Dirids还不健全,所以使用“/RepVars”参数时,会把“C:\Program Files (x86)\Common Files”这种目录,会转成“%16422% (x86)\Common Files”。
希望帮忙改进,注册表的数值路径不该转换。优先处理最长的目录,补全dirids。如果也能支持转为cmd就更好了。
  1. [DestinationDirs]
  2. -1 Absolute path
  3. 1  %~dp0%
  4. 00 Null LDID [this LDID can be used to create a new LDID]
  5. 01 Source Drive_Letter:\Path_Name  (the directory from which the INF file was installed)
  6. 02 Temp Setup
  7. 03 Uninstall
  8. 04 Backup
  9. 10 Windows directory. %SystemRoot%.
  10. 11 System directory. %SystemRoot%\system32.
  11. 12 Drivers directory. %SystemRoot%\system32\drivers.
  12. 13 Driver package's Driver Store directory. For Windows 8.1 and later, specifies the path to the Driver Store directory where the driver package was imported.
  13.    The optional subdirectory in the SourceDiskFiles section for a file must match the subdirectory in the DestinationDirs section for the entry that applies to this file.
  14.    Don't use DelFiles on a file for which DestinationDirs includes dirid 13.
  15.    Don't use CopyFiles to rename a file for which DestinationDirs includes dirid 13.
  16. 14 Control Panel
  17. 15 Printers
  18. 16 Workgroup
  19. 17 INF Directory [%windir%\INF]
  20. 18 Help directory [%windir%\HELP]
  21. 19 Administration
  22. 20 Fonts [%windir%\FONTS]
  23. 21 Viewers [%windir%\SYSTEM\VIEWERS]
  24. 22 VMM32 [%windir%\SYSTEM\VMM32]
  25. 23 Color directory [%windir%\SYSTEM\COLOR]
  26. 24 Root of drive containing the Windows files are installed directory. e.g., if dirid 10 is "C:\winnt", then dirid 24 is "C:\".
  27. 25 Shared directory
  28. 26 Guaranteed boot device for Windows (Winboot) [C:\ root]
  29. 27 Machine [%windir%]
  30. 28 Host Winboot [usually C:\ root]
  31. 30 Root directory of the boot disk, also known as "ARC system partition". (This might or might not be the same directory as the one represented by dirid 24.)
  32. 31 Root directory of the Host drive of a virtual boot drive [usually C:\ root]
  33. 50 System directory. This is equivalent to %SystemRoot%\system.
  34. 51 Spool directory. (not used for installing printer drivers - see Printer Dirids)
  35. 53 User profile directory.
  36. 54 Directory where Ntldr.exe and Osloader.exe are located.
  37. 55 Print processors directory. (not used for installing printer drivers)
  38. 16384 %USERPROFILE%\Desktop
  39. 16386 %USERPROFILE%\Start Menu\Programs
  40. 16389 %USERPROFILE%\Documents
  41. 16390 %USERPROFILE%\Favorites
  42. 16391 %USERPROFILE%\Start Menu\Programs\Startup
  43. 16392 %USERPROFILE%\Recent
  44. 16393 %USERPROFILE%\SendTo
  45. 16395 %USERPROFILE%\Start Menu
  46. 16397 %USERPROFILE%\Music
  47. 16398 %USERPROFILE%\Videos
  48. 16400 %USERPROFILE%\Desktop
  49. 16403 %USERPROFILE%\NetHood
  50. 16405 %USERPROFILE%\Templates
  51. 16406 %ALLUSERSPROFILE%\Start Menu
  52. 16407 %ALLUSERSPROFILE%\Start Menu\Programs
  53. 16408 %ALLUSERSPROFILE%\Start Menu\Programs\Startup
  54. 16409 %ALLUSERSPROFILE%\Desktop
  55. 16410 %USERPROFILE%\Application Data
  56. 16411 %USERPROFILE%\PrintHood
  57. 16412 %USERPROFILE%\Local Settings\Application Data
  58. 16415 %ALLUSERSPROFILE%\Favorites
  59. 16416 %USERPROFILE%\Local Settings\Temporary Internet Files
  60. 16417 %USERPROFILE%\Cookies
  61. 16418 %USERPROFILE%\Local Settings\History
  62. 16419 %ALLUSERSPROFILE%\Application Data
  63. 16422 %ProgramFiles%
  64. 16423 %USERPROFILE%\Pictures
  65. 16425 %SystemRoot%\system32 (valid for Microsoft Win32 user-mode applications that are running under Windows on Windows (WOW64))
  66. 16426 Program Files (valid for Win32 user-mode applications that are running under WOW64)
  67. 16427 %ProgramFiles%\Common Files
  68. 16428 Program Files\Common (valid for Win32 user-mode applications that are running under WOW64)
  69. 16429 %ALLUSERSPROFILE%\Templates
  70. 16430 %ALLUSERSPROFILE%\Documents
  71. 16431 %ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools
  72. 16432 %USERPROFILE%\Start Menu\Programs\Administrative Tools
  73. 16437 %ALLUSERSPROFILE%\Documents\My Music
  74. 16438 %ALLUSERSPROFILE%\Documents\My Pictures
  75. 16439 %ALLUSERSPROFILE%\Documents\My Videos
  76. 16440 %SystemRoot%\Resources
  77. 16441 %SystemRoot%\Resources\0409
  78. 16443 %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning
复制代码
1

评分人数

    • ivor: 感谢分享技术 + 1

一直用的这个:http://bcn.bathome.net/tool/reg2inf.exe
同时感谢lz分享

TOP

返回列表