读取和C ++程序设置组策略设置组策略、程序

2023-09-08 13:27:41 作者:〆霸气开爷°

我有一个独立的基于Windows-NT机(未连接到任何网络),我希望能读,后来通过一个C ++程序中设置的组策略设置。

I have a standalone Windows-NT based machine (not connected to any network) and I want to be able to read and later set the Group Policy settings via a C++ program.

下面是我会做手工。运行GPEDIT.MSC以管理员身份,然后说我想prevent用户访问注册表。所以在本地组策略编辑器我要到

Here's what I would do manually. Run gpedit.msc as administrator, then say I want to prevent users from accessing registry. So in the "Local Group Policy Editor" I'll go to

用户配置 - >管理模板 - >系统 - >prevent访问注册表编辑工具

User Configuration -> Administrative Templates -> System -> "Prevent access to registry editing tools"

和将其设置为已启用

有没有办法做到从C ++程序一样吗?任何code样品将大大AP preciated!

Is there any way to do the same from a C++ program? Any code samples would be greatly appreciated!

推荐答案

您可以使用的组策略API 。