|
-
Jun 20th, 2007, 05:58 PM
#1
Thread Starter
Member
[2005] Task Manager + Registry
I have a form, 2 buttons, i am able to disable task manager but it doesn't enable.
Button 1 Click.
Code:
Dim regkey As RegistryKey
regkey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
regkey.SetValue("DisableTaskMgr", "0")
Button 2 Click.
Code:
Dim regkey As RegistryKey
regkey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
regkey.SetValue("DisableTaskMgr", "1")
Am i doing something wrong?
Is there another way to change a value of the registry key?
Thanks
Edit: When i go into registry and try manual edit it to change the value to "0" so that it is enabled, it doesn't work.
The way i have enabled it is to go into gpedit.msc and do it from there, even though it is set to "not configured" in gpedit.
Hope that makes sense.
Last edited by Wulfgur; Jun 21st, 2007 at 02:05 AM.
-
Jun 21st, 2007, 01:58 AM
#2
Member
Re: [2005] Task Manager + Registry
The problem is that you use a string value when the value must be a Dword.
Code:
'Enable
Microsoft.Win32.Registry.SetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", _
"DisableTaskMgr", 0, Microsoft.Win32.RegistryValueKind.DWord)
Code:
'Disable
Microsoft.Win32.Registry.SetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", _
"DisableTaskMgr", 1, Microsoft.Win32.RegistryValueKind.DWord)
-
Jun 21st, 2007, 02:05 AM
#3
Thread Starter
Member
Re: [2005] Task Manager + Registry
-
Jun 21st, 2007, 08:28 AM
#4
Re: [2005] Task Manager + Registry
While this is fine as a learning exercise, this kind of code should not be used in a production application. Instead, you should have the network administrator set policies for personal computer usage, which can include not allowing access to Task Manager, and you should not give ordinary users local administrative rights on their computers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|