使用IGroupPolicyObject更新Windows 7中的本地计算机策略 [英] Update the Local Computer Policy in Windows 7 with IGroupPolicyObject

查看:350
本文介绍了使用IGroupPolicyObject更新Windows 7中的本地计算机策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想能够以编程方式执行gpedit.msc的工作.我正在尝试将这些键的值设置为1并更新本地组注册表.

I just want to be able to programmatically do what gpedit.msc does. I'm trying to set the value of these keys to 1 and Update the Local Group Registry.

在gpedit.msc中:

本地计算机策略/计算机配置/管理模板/系统/可移动存储访问

ValueName::所有可移动存储类:拒绝所有访问

ValueName: All Removable Storage classes: Deny all access

:1(将此设置为1)

Value: 1 (set this to 1)

本地计算机策略/计算机配置/管理模板/Windows组件/自动播放策略

ValueName :关闭自动播放

值: 1(将其设置为1)

Value: 1 ( set this to 1)

我认为关键是要在C ++中使用IGroupPolicyObject.但是,我找不到任何可以整理的文档.

I think the key is to use IGroupPolicyObject in C++. However, I can't find any documentation that I can wrap my head around.

我的应用程序需要禁用/启用所有USB访问,而不必重新启动Windows 7.

My application needs to disable/enable all USB Access without having to reboot Windows 7.

推荐答案

我认为这些链接将为您提供帮助:

I think that these links will help you:

通过ComImport机制更改LGPO对象的C#代码

C# code that alters LGPO object by ComImport mechanism Software Developer's Bytes - Group Policy Object via .NET\C#

这篇关于使用IGroupPolicyObject更新Windows 7中的本地计算机策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆