Click here to Skip to main content
15,998,100 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

VB
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
Posted
Comments
[no name] 19-Sep-13 5:57am    
You need administrator privileges to write to the registry.

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900