Satal Keto
Well-known member
- Joined
- May 15, 2006
- Messages
- 86
- Programming Experience
- 5-10
Hello I am trying to make a program for the administrators at my school.
What I am trying to do is make a program which the administrators can run on each computer in the school and it will edit the registry so that the children in the school can't access CMD or run batch files (as they was using it to send messages, which they weren't supposed to be able to).
I have written the program (very simple but this is my first VB.Net program so it would be simple anyway). The problem I have is that this simple code doesn't seem to work. I was wondering if anyone would be able to figure out why it doesn't work.
I have attached a printscreen of the error that i recieve hopefully it will help.
Thank you for any help in advance
What I am trying to do is make a program which the administrators can run on each computer in the school and it will edit the registry so that the children in the school can't access CMD or run batch files (as they was using it to send messages, which they weren't supposed to be able to).
I have written the program (very simple but this is my first VB.Net program so it would be simple anyway). The problem I have is that this simple code doesn't seem to work. I was wondering if anyone would be able to figure out why it doesn't work.
VB.NET:
Imports Microsoft
Imports Microsoft.Win32
Imports Microsoft.Win32.Registry
Public Class Form1
Private Sub cmd_disable_cmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_disable_cmd.Click
'Software\Policies\Microsoft\Windows\System
Dim key As RegistryKey
key = Registry.CurrentUser.OpenSubKey("Software\Policies\Microsoft\Windows\System", True)
Dim newkey As New Object
newkey = key.CreateSubKey("DisableCMD")
newkey.SetValue("DisableCMD", "1")
key.Close()
End Sub
End Class
Thank you for any help in advance