是否可以通过脚本添加高级注册表项权限?
IE:
HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Defaults\FirewallPolicy
MpsSvc – 查询值、设置值、创建子键、枚举子键、通知、删除、读取控制
答案1
您可以使用Powershell 脚本, 一些例子:
列出所有子项:
PS> Get-ChildItem -Path hkcu:\
Hive: Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER
SKC VC Name Property
--- -- ---- --------
2 0 AppEvents {}
7 33 Console {ColorTable00, ColorTable01, ColorTab...
25 1 Control Panel {Opened}
0 5 Environment {APR_ICONV_PATH, INCLUDE, LIB, TEMP...}
1 7 Identities {Last Username, Last User ...
4 0 Keyboard Layout {}
...
创建密钥(2 种方式):
PS> New-Item -Path hkcu:\software\_DeleteMe
PS> New-Item -Path Registry::HKCU\_DeleteMe
删除一个键:
PS> Remove-Item -Path hkcu:\Software\_DeleteMe
PS> Remove-Item -Path 'hkcu:\key with spaces in the name'