Home All Groups Group Topic Archive Search About

How to know if Windows Update is ON or OFF?

Author
18 Jan 2006 2:34 PM
Lars Netzel
Hi

Is it possible to get information on how the settings are set in windows
thru vb.net?

best regards
/Lars Netzel

Author
18 Jan 2006 2:59 PM
Armin Zingler
"Lars Netzel" <uih***@adf.se> schrieb
> Hi
>
> Is it possible to get information on how the settings are set in
> windows thru vb.net?


http://msdn.microsoft.com/library/en-us/wua_sdk/wua/portal_client.asp

There's a note you can add a COM reference to "WUAPI 2.0 Type Library"
(wuapi.dll).

After that you can do something like

    Dim wua As New AutomaticUpdates

    MsgBox(wua.ServiceEnabled)


Armin
Author
19 Jan 2006 7:23 AM
Lars Netzel
Thank you! You know your stuff it seems

/Lars


Show quoteHide quote
"Armin Zingler" <az.nospam@freenet.de> wrote in message
news:eLY8E$DHGHA.1192@TK2MSFTNGP11.phx.gbl...
> "Lars Netzel" <uih***@adf.se> schrieb
>> Hi
>>
>> Is it possible to get information on how the settings are set in
>> windows thru vb.net?
>
>
> http://msdn.microsoft.com/library/en-us/wua_sdk/wua/portal_client.asp
>
> There's a note you can add a COM reference to "WUAPI 2.0 Type Library"
> (wuapi.dll).
>
> After that you can do something like
>
>    Dim wua As New AutomaticUpdates
>
>    MsgBox(wua.ServiceEnabled)
>
>
> Armin
Author
19 Jan 2006 11:03 AM
Armin Zingler
"Lars Netzel" <uih***@adf.se> schrieb
> Thank you! You know your stuff it seems


I did not know where it was located. I have a table of content, and I use
the help "index" and "search".


Armin
Author
3 Mar 2006 10:19 PM
Ken Halter
"Armin Zingler" <az.nospam@freenet.de> wrote in message
news:eLY8E$DHGHA.1192@TK2MSFTNGP11.phx.gbl...
>
> After that you can do something like
>
>    Dim wua As New AutomaticUpdates
>
>    MsgBox(wua.ServiceEnabled)
>
>
> Armin

Hey! That's kinda neat <g> A VB6 version.....
'=====
Private Sub Command1_Click()

   Dim oWinUpdate As AutomaticUpdates
   Dim oSettings As IAutomaticUpdatesSettings

   Set oWinUpdate = New AutomaticUpdates

   Set oSettings = oWinUpdate.Settings

   Select Case oSettings.NotificationLevel
      Case aunlDisabled
         Debug.Print "NotificationLevel: Disabled"
      Case aunlNotConfigured
         Debug.Print "NotificationLevel: Not Configured"
      Case aunlNotifyBeforeDownload
         Debug.Print "NotificationLevel: Notify Before Download"
      Case aunlNotifyBeforeInstallation
         Debug.Print "NotificationLevel: Notify Before Installation"
      Case aunlScheduledInstallation
         Debug.Print "NotificationLevel: Scheduled Installation"
   End Select

End Sub
'=====

There seems to be all kinds of goodies hidden in that DLL. I may incorporate
something like this into my next project. We build factory automation
machines and use "run of the mill" PCs for computers. The first thing that
happens when we ship to a customer is.... they install their corporate virus
scanner (which bloats the system and may cause major problems) and enable
Windows Update. No matter how many times we tell them that "this is not to
be confused with a desktop PC", once it's in their hands, we lose all
control. Both AV and WU absolutely >can not run and must be completely
disabled< (no screen savers either) while we're controlling servo's, etc.

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..