注册表脚本简单点玩:添加、删除键

来源:互联网 发布:矩阵论教材 编辑:程序博客网 时间:2024/05/22 06:37

go:http://hi.baidu.com/cupenoruler/item/ed93fa2669bc5d3794f62bbe

建个文本,首先第一行:
    Windows Registry Editor Version 5.00

    (version几就不管了,固定写 5.00 ,XP和win7都测试通过了)。

下面空一行再写(遵照注册表编辑导出的格式)
    项( 注意用中括号标识)

       [XX\OO\xx\oo]

       [-XX\OO\xx\oo]    //表示删除该项

    项的下一行就是对键的操作了,我暂时只有字符串键的例子,其他的也差不多。

       键名=键值

       键名=-                //表示删除该键
       
一个添加开机启动项的例子如下:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"LanZhouShaoBing"="C:\\Windows\\System32\\ctfmon.exe"

另一个删除开机启动项的例子如下:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"LanZhouShaoBing"=-


可以一次性添加多个键,也可以多给几个项添加键,
找实际例子来试太麻烦,这几个重复的字符能表达我的意思就成,如下:

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"LanZhouShaoBing1"="C:\\Windows\\System32\\ctfmon.exe""LanZhouShaoBing2"="C:\\Windows\\System32\\ctfmon.exe""LanZhouShaoBing3"="C:\\Windows\\System32\\ctfmon.exe"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"LanZhouShaoBing"="C:\\Windows\\System32\\ctfmon.exe"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"LanZhouShaoBing"="C:\\Windows\\System32\\ctfmon.exe"


OK~  文件名改为XXOO.reg, 双击之~ O了~
太简单了,我忍不住怀疑我写水段子会不会被BS~

 

原创粉丝点击