如何允许应用程序在Win7中写入注册表 [英] How to allow application to write to registry in Win7

查看:193
本文介绍了如何允许应用程序在Win7中写入注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我迫切需要这个问题的帮助:我有以下代码在Windows XP上完美运行,但相同的代码会引发关于访问注册表项被拒绝的错误。

这是代码:



I desperately need help with this problem: I have the follwing code that works perfectly on Windows XP, but the same code throws up an error about access to registry key being denied.
Here is the code:

Private Sub KillTaskManager()
        Dim regkey As RegistryKey
        Dim keyValueInt As String = "1"
        Dim subKey As String = "Software\Microsoft\Windows\CurrentVersion\Policies\System"
        Try
            regkey = Registry.CurrentUser.CreateSubKey(subKey)
            regkey.SetValue("DisableTaskMgr", keyValueInt)
            regkey.Close()
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, "Registry Error!")
        End Try
    End Sub





任何人都可以建议解决方案



Can anyone suggest solution

推荐答案

如果要禁用某些程序,请不要为该puprose编写自己的小程序。请改用组策略 - 最好在域级别定义它们。
If you want to disable some programs, do not write your own little programs for that puprose. Use Group Policies instead - best define them at Domain level.


这篇关于如何允许应用程序在Win7中写入注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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