找回密码
 加入
搜索
查看: 3742|回复: 3

[效率算法] 分离注册表文件【已解决】

[复制链接]
发表于 2012-8-25 09:08:18 | 显示全部楼层 |阅读模式
本帖最后由 q113960096 于 2012-8-25 14:05 编辑

我不知道用这个title 合不合适,我也想不出别的title就先用这个吧。
Windows Registry Editor Version 5.00

[code]Windows Registry Editor Version 5.00

; Generated by Total Uninstall


[HKEY_USERS\S-1-5-21-2025429265-1677128483-1801674531-500\SOFTWARE\115]

[HKEY_USERS\S-1-5-21-2025429265-1677128483-1801674531-500\SOFTWARE\115\Box]
"ID"=dword:00000124
"Exe"="C:\\Documents and Settings\\Administrator\\Application Data\\115\\Box\\115Box.exe"

[HKEY_USERS\S-1-5-21-2025429265-1677128483-1801674531-500\SOFTWARE\115\UDown]
"PID"=dword:00000000
"UID"=dword:00000000
"Ver"="3.3.1.13"
"Path"="C:\\Program Files\\115\\UDown\\UDown.exe"
"UVer"=dword:00000000
"InstallDir"="C:\\Program Files\\115"
"AppDataPath"="C:\\Documents and Settings\\All Users\\Application Data\\115\\UDown\"
"InstallLang"="2052"
"ThumbnailCachePath"="C:\\Documents and Settings\\All Users\\Documents\\115\\UDown"

[HKEY_USERS\S-1-5-21-2025429265-1677128483-1801674531-500\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\UDown.exe]
@="C:\\Program Files\\115\\UDown\\UDown.exe"

[HKEY_USERS\S-1-5-21-2025429265-1677128483-1801674531-500\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\115优蛋]
"Publisher"="广东一一五科技有限公司"
"DisplayIcon"="C:\\Program Files\\115\\UDown\\UDown.exe"
"DisplayName"="115优蛋"
"URLInfoAbout"="http://www.115.com/"
"DisplayVersion"="3.3.1.13"
"UninstallString"="C:\\Program Files\\115\\UDown\\uninst.exe"

[HKEY_USERS\S-1-5-21-2025429265-1677128483-1801674531-500\SOFTWARE\Microsoft\Windows\CurrentVersion\App Management\ARPCache\115优蛋]
"Changed"=dword:00000000
"SlowInfoCache"=hex:28,02,00,00,01,00,00,00,00,90,0E,01,00,00,00,00,12,3D,E4,\
  21,D7,7C,CD,01,05,00,00,00,43,00,3A,00,5C,00,50,00,72,00,6F,00,67,00,72,00,\
  61,00,6D,00,20,00,46,00,69,00,6C,00,65,00,73,00,5C,00,31,00,31,00,35,00,5C,\
  00,55,00,44,00,6F,00,77,00,6E,00,5C,00,55,00,44,00,6F,00,77,00,6E,00,2E,00,\
  65,00,78,00,65,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00
然后分离每一个键以及键值例如:

===========================1.reg===========================
[HKEY_USERS\S-1-5-21-2025429265-1677128483-1801674531-500\SOFTWARE\115\UDown]
"PID"=dword:00000000
"UID"=dword:00000000
"Ver"="3.3.1.13"
"Path"="C:\\Program Files\\115\\UDown\\UDown.exe"
"UVer"=dword:00000000
"InstallDir"="C:\\Program Files\\115"
"AppDataPath"="C:\\Documents and Settings\\All Users\\Application Data\\115\\UDown\"
"InstallLang"="2052"
"ThumbnailCachePath"="C:\\Documents and Settings\\All Users\\Documents\\115\\UDown"
===========================2.reg===========================
[HKEY_USERS\S-1-5-21-2025429265-1677128483-1801674531-500\SOFTWARE\Microsoft\Windows\CurrentVersion\App Management\ARPCache\115优蛋]
"Changed"=dword:00000000
"SlowInfoCache"=hex:28,02,00,00,01,00,00,00,00,90,0E,01,00,00,00,00,12,3D,E4,\
  21,D7,7C,CD,01,05,00,00,00,43,00,3A,00,5C,00,50,00,72,00,6F,00,67,00,72,00,\
  61,00,6D,00,20,00,46,00,69,00,6C,00,65,00,73,00,5C,00,31,00,31,00,35,00,5C,\
  00,55,00,44,00,6F,00,77,00,6E,00,5C,00,55,00,44,00,6F,00,77,00,6E,00,2E,00,\
  65,00,78,00,65,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00
可能表达不是很清晰,请大家谅解。谢谢!我百度,GOOGLE,没找到,自己想都想不出来,也试过用 string 尝试都失败啦。
发表于 2012-8-25 10:20:59 | 显示全部楼层
$regfilecontent = FileRead("原.reg")
$regkey = StringRegExp($regfilecontent&"[", "(HKEY[\s\S]*?)\[", 3)
For $i=0 To UBound($regkey)-1
        FileWrite($i&".reg", "["&$regkey[$i])
Next
正则学得不好,将就一下吧,效果是达到了~
 楼主| 发表于 2012-8-25 10:26:15 | 显示全部楼层
本帖最后由 q113960096 于 2012-8-25 14:05 编辑

回复 2# ajian55


    感谢,感谢。正则写的很巧妙。
发表于 2012-8-25 10:29:34 | 显示全部楼层
回复 2# ajian55


  不懂正则,能解释下什么含义吗
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-21 02:36 , Processed in 0.079999 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表