需要删除某个注册表的键值
解决方案:
在本机的命令行(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 |