免费注册 查看新帖 |

Chinaunix

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

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

论坛徽章:
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


继续求助中。。。

论坛徽章:
46
15-16赛季CBA联赛之四川
日期:2018-03-27 11:59:132015年亚洲杯之沙特阿拉伯
日期:2015-04-11 17:31:45天蝎座
日期:2015-03-25 16:56:49双鱼座
日期:2015-03-25 16:56:30摩羯座
日期:2015-03-25 16:56:09巳蛇
日期:2015-03-25 16:55:30卯兔
日期:2015-03-25 16:54:29子鼠
日期:2015-03-25 16:53:59申猴
日期:2015-03-25 16:53:29寅虎
日期:2015-03-25 16:52:29羊年新春福章
日期:2015-03-25 16:51:212015亚冠之布里斯班狮吼
日期:2015-07-13 10:44:56
3 [报告]
发表于 2010-11-25 10:14 |只看该作者
本帖最后由 zhlong8 于 2010-11-25 10:26 编辑

少个文件或模块 /Win32/Registry/Export.pm 应该

CPAN能找到下面那个吗?你装的是下面那个吗, ActivePerl 中是 0.10 版的没这个方法

论坛徽章:
0
4 [报告]
发表于 2010-11-25 10:33 |只看该作者
cpan那个没有。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP