====== Getting the Windows automatic update prompt to appear (inc. RDP sessions) ======
Often the Windows update shield in the system tray won't appear when you RDP into systems. A fairly reliable trick seems to be the following:
- Stop the Automatic Update service ( ''net stop wuauserv'' from the command line ).
- Set the ''NextFeaturedUpdatesNotificationTime'' key ( located at ''HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\'' ) to a date and time slightly ahead (say a minute or two) of the present.
- Start the Automatic Update service ( ''net start wuauserv'' ).
Or use this script (save as .vbs):
Waiting for wuauserv service to stop
Dim newDate, newDateFormatted, newYear, newMonth, newDay, newHour, newMinute, newSecond, notificationString, strHTML
Dim objExplorer, objWshShell, objWMIService, objService
newDate = DateAdd("n", 2, Now)
newYear = Year(newDate)
newMonth = zeropad(Month(newDate), 2)
newDay = zeropad(Day(newDate), 2)
newHour = zeropad(Hour(newDate), 2)
newMinute = zeropad(Minute(newDate), 2)
newSecond = zeropad(Second(newDate), 2)
newDateFormatted = newYear & "-" & newMonth & "-" & newDay & " " & newHour & ":" & newMinute & ":" & newSecond
Private Function zeroPad(m, t)
zeroPad = String(t-Len(m),"0")&m
End Function
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 400
objExplorer.Height = 200
objExplorer.Visible = 1
objExplorer.Document.Title = "Kicking Updater"
Set objWshShell = CreateObject( "WScript.Shell" )
Set objWMIService = GetObject( "winmgmts://./root/cimv2" )
Set objService = objWMIService.Get("Win32_Service.Name='wuauserv'")
objService.StopService()
While objService.Started
strHTML = strHTML & "
Waiting for wuauserv service to start
" objExplorer.Document.Body.InnerHTML = strHTML WScript.Sleep 1000 Set objService = objWMIService.Get("Win32_Service.Name='wuauserv'") Wend strHTML = strHTML & "Finished. The Update notifier should pop up in the tray at " & FormatDateTime(newDate, 3) & "
" objExplorer.Document.Body.InnerHTML = strHTML Set objService = Nothing Set objWMIService = Nothing Set objWshShell = Nothing Set objExplorer = Nothing Wscript.Quit