Setting Automatic Updates via the registry in XP/2000.

T

Ty Moffett

Below is a set of insructions that changes the registry keys pertaining to
Automatic Updates on my Windows XP box.

I can make changes using the control panel applet and see the changes
reflected via regedit.exe. However when I make the changes with the code
below those changed are NOT reflected in the control panel applet even
though they are actully being set.

Does anyone have any experience with this?

Thanks again!

Imports Microsoft.Win32

Module Module1

Sub Main()

Dim rk As RegistryKey =
Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows\CurrentVersio
n\WindowsUpdate\Auto Update")

rk.SetValue("NoAutoUpdate", 0)

rk.SetValue("AUOptions", 4)

rk.SetValue("ScheduledInstallTime", 12)

rk.SetValue("ScheduledInstallDay", 0)

End Sub

End Module
 
S

Shawn D Shelton

Hi Ty,

try putting in double backslashes like this:

Dim Reg As RegistryKey
Dim keyValue As String

keyValue =
"Software\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update"

Reg = Registry.CurrentUser.OpenSubKey(keyValue, True)
If Reg Is Nothing Then
' Key doesn't exist; create it.
Reg = Registry.CurrentUser.CreateSubKey(keyValue)
End If

reg.SetValue("NoAutoUpdate", 0)
reg.SetValue("AUOptions", 4)
reg.SetValue("ScheduledInstallTime", 12)
reg.SetValue("ScheduledInstallDay", 0)

****You might have to reboot the machine to load the changed registry so
that the changes are reflected in the control panel applet***

Good Luck!

Shawn Shelton
 
T

Ty Moffett

It's always the small stuff. After a reboot the control panel showed the
right information.

Thanks Shawn. =)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top