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