Results 1 to 4 of 4

Thread: [2005] Task Manager + Registry

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2006
    Posts
    63

    Resolved [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.

  2. #2
    Member
    Join Date
    Feb 2007
    Location
    Sweden
    Posts
    50

    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)

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2006
    Posts
    63

    Re: [2005] Task Manager + Registry

    Ok thanks heaps

  4. #4
    Fanatic Member bgmacaw's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, GA USA
    Posts
    524

    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
  •  



Click Here to Expand Forum to Full Width