服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

运维之家

 找回密码
 注册
搜索
查看: 5173|回复: 0

命令行(CMD)界面下实现对注册表键值的删除

[复制链接]
administrator 发表于 2005-11-23 22:25:56 | 显示全部楼层 |阅读模式

需要删除某个注册表的键值

解决方案:

在本机的命令行(CMD)界面下,可以用REG命令来实现对注册表键值的删除:

REG命令的说明如下:

REG DELETE KeyName [/v valueName | /ve | /va] [/f]

KeyName    [\\Machine\]FullKey

    Machine  Name of remote machine - omitting defaults to the current machine

             Only HKLM and HKU are available on remote machines

    FullKey  ROOTKEY\SubKey

    ROOTKEY  [ HKLM | HKCU | HKCR | HKU | HKCC ]

    SubKey   The full name of a registry key under the selected ROOTKEY

  valueName  The value name, under the selected Key, to delete

             When omitted, all subkeys and values under the Key are deleted

  /ve        delete the value of empty value name <no name>

  /va        delete all values under this key

  /f         Forces the deletion without prompt

命令例子:

REG DELETE HKLM\Software\MyCo\MyApp\Timeout /f

   Force to deletes the registry key Timeout and its all subkeys and values

REG DELETE \\ZODIAC\HKLM\Software\MyCo /v MTU

   Deletes the registry value MTU under MyCo on ZODIAC(computer name)r

建议方案:

1)     把 REG DELETE … /F 写入脚本(script.bat)
2)     修改default domain group policy或者 联系相应OU 的group policy object
3)     把步骤1)中生成的script.bat 作为用户登录的logon script

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|运维之家

GMT+8, 2024-3-29 07:25 , Processed in 0.090772 second(s), 14 queries .

Powered by Dirtysea

© 2008-2020 Dirtysea.com.

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