Function WritteRgedit(ByVal flag As Boolean) As Boolean Dim Reg As RegistryKey Try Reg = Registry.LocalMachine.CreateSubKey("software\Microsoft\windows update") Reg.CreateSubKey("condition") If flag = True Then Reg.SetValue("condition", "1") Else Reg.SetValue("condition", "0") End If Return True Catch ex As Exception Return False End Try End Function