免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1942 | 回复: 2
打印 上一主题 下一主题

备 份 注 册 表 项的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-11-25 09:43 |显示全部楼层 |倒序浏览
本帖最后由 perlw01f 于 2010-11-25 09:45 编辑
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Win32::Registry;
  5. my $Register = "SYSTEM\\CurrentControlSet\\Control\\Citrix";
  6. my $hkey;
  7. $::HKEY_LOCAL_MACHINE->Open($Register, $hkey)|| die $!;
  8. $hkey->Save('c:\test1.reg');
  9. $hkey->Close();
复制代码
得到的文件 8Kb 且不是正常的 reg文件格式
从 Citrix export得到的reg文件 1Kb
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\wfshell]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\wfshell\TWI]
"LogoffCheckSysModules"="acrotray.exe,acrodist.exe,Acrobat.exe"


请 教 如何 得到 后面的这种格式?
谢 谢

论坛徽章:
0
2 [报告]
发表于 2010-11-25 09:53 |显示全部楼层
本帖最后由 perlw01f 于 2010-11-25 10:06 编辑

怪异
http://search.cpan.org/~jdb/Win32-Registry-0.10/Registry.pm 没有export方法

但是这个
http://jenda.krynicky.cz/perl/Registry.pm.html居然有export方法。。。

Export

     $obj->Export( [$filename, [$continuation]] )

    Export the key into a registry script (.REG) file. This method creates a standard registry script, the same you get when you export a key from Regedit.exe.

    If you do not specify the $filename, the text gets printed to the currently select()ed filehandle.

    If the $continuation is defined, no header is printed out. You may use this to export several keys into one file.

    If you do not want to specify the filename, but need continuation, use undef() as the $filename.

本机试用 export
Can't locate auto/Win32/Registry/Export.al in @INC (@INC contains: C:\ C:/Perl/site/lib C:/Perl/lib .) at C:\Users\UserA\AppData\Local\Temp\dir108E.tmp\test1.pl


继续求助中。。。

论坛徽章:
0
3 [报告]
发表于 2010-11-25 10:33 |显示全部楼层
cpan那个没有。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP