By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,795 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,795 IT Pros & Developers. It's quick & easy.

Setting Automatic Updates via the registry in XP/2000.

P: n/a
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\Micro soft\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
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Ty,

try putting in double backslashes like this:

Dim Reg As RegistryKey
Dim keyValue As String

keyValue =
"Software\\Microsoft\\Windows\\CurrentVersion\\Win dowsUpdate\\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

Ty Moffett wrote:
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\Micro soft\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


Nov 20 '05 #2

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

Thanks Shawn. =)

"Shawn D Shelton" <sh******@isu.edu> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl...
Hi Ty,

try putting in double backslashes like this:

Dim Reg As RegistryKey
Dim keyValue As String

keyValue =
"Software\\Microsoft\\Windows\\CurrentVersion\\Win dowsUpdate\\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

Ty Moffett wrote:
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\Micro soft\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

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.