I'm making a program that will disable forced automatic restart on update, to do this it needs to write to the HKLM registry.

When i run the program in VS2010 it returns an error "UnauthorizedAccessException", i assumed this was beacuse it was running without admin permissions however when i run the program as an administrator it doesn't make any changes to the registry or report any errors.

Code:
Imports Microsoft.Win32

Public Class Form1

    Private Sub BtnRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnRun.Click
        QuickFix()
        Timer1.Enabled = True
        ProgressBar1.Value = "0"
    End Sub

    Private Sub CheckStatus()
        Dim readValue As String
        readValue = My.Computer.Registry.GetValue _
        ("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", "NoAutoRebootWithLoggedOnUsers", Nothing)
        If readValue = "1" Then
            MsgBox("Automatic forced restart is already disabled", MsgBoxStyle.Information, "Quick Fix 001: Already Disabled.")
        Else
            MsgBox("Automatic forced restart is enabled", MsgBoxStyle.Information, "Quick Fix 001: Already Disabled.")
        End If
    End Sub

    Private Sub QuickFix()
        ''My.Computer.Registry.LocalMachine.CreateSubKey("SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")
        My.Computer.Registry.LocalMachine.SetValue("SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", _
        "NoAutoRebootWithLoggedOnUsers", "1")
        My.Computer.Registry.LocalMachine.Close()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ProgressBar1.Value = ProgressBar1.Value + 1
        If ProgressBar1.Value = 50 Then
            CheckStatus()
        End If
        If ProgressBar1.Value = 100 Then
            Timer1.Enabled = False
        End If
    End Sub

    Private Sub BtnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCancel.Click
        End
    End Sub

End Class