Results 1 to 7 of 7

Thread: WUAPI Help

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    WUAPI Help

    Hello friends

    I need your help in WUAPI.dll for automatic update.
    I have a project to search for updates in localintranet and get the updates and install them.
    i can not find any help for WUAPI on the msdn and how to use it

    Please help me with that

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: WUAPI Help

    Welcome to the Forums.

    Here is a link to the wuapi.dll overview on MSDN.
    Windows Update Agent API

    And below that topic is how to use the wuapi.dll

    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Re: WUAPI Help

    Thank you for replying

    But in fact i need a sample source code about this subject and i do not want vbscript, i need it pure vb to use it with application

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: WUAPI Help

    To start, add a reference to the wuapi.dll to a new vb standard exe project.
    Then explore the methods and properties available using the Object Browser (F2).

    I guess its just going to be trial and error.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: WUAPI Help

    I was boared so I started on a small example for you.

    This works for SUS version 2.0 and you can check out this link for determining the version.

    VB Code:
    1. Option Explicit
    2. 'Add reference to wuapi.dll in the system32 directory
    3. 'Valid only for Windows 2000 SP3+
    4. Private Enum ausid
    5.     ausidEveryDay = 0
    6.     ausidEverySunday = 1
    7.     ausidEveryMonday = 2
    8.     ausidEveryTuesday = 3
    9.     ausidEveryWednesday = 4
    10.     ausidEveryThursday = 5
    11.     ausidEveryFriday = 6
    12.     ausidEverySaturday = 7
    13. End Enum
    14.  
    15. Private Enum aunl
    16.     aunlNotConfigured = 0
    17.     aunlDisabled = 1
    18.     aunlNotifyBeforeDownload = 2
    19.     aunlNotifyBeforeInstallation = 3
    20.     aunlScheduledInstallation = 4
    21. End Enum
    22.  
    23. Private Sub Command1_Click()
    24.    
    25.     Dim oUP As WUApiLib.AutomaticUpdates
    26.     Dim oUPSearcher As UpdateSearcher
    27.     Dim sLevel As String
    28.     Dim sDay As String
    29.     Dim sTime As String
    30.    
    31.     Set oUP = New AutomaticUpdates
    32.     'oUP.ShowSettingsDialog 'Uncomment if you want to display the dialog
    33.     oUP.EnableService
    34.     MsgBox "Service enabled: " & oUP.ServiceEnabled
    35.    
    36.     Select Case oUP.Settings.NotificationLevel
    37.         Case 0
    38.             sLevel = "Not Configured"
    39.         Case 1
    40.             sLevel = "Disabled"
    41.         Case 2
    42.             sLevel = "Notify Before Download"
    43.         Case 3
    44.             sLevel = "Notify Before Installation"
    45.         Case 4
    46.             sLevel = "Scheduled Installation"
    47.     End Select
    48.     Select Case oUP.Settings.ScheduledInstallationDay
    49.         Case 0
    50.             sDay = "Every Day"
    51.         Case 1
    52.             sDay = "Every Sunday"
    53.         Case 2
    54.             sDay = "Every Monday"
    55.         Case 3
    56.             sDay = "Every Tuesday"
    57.         Case 4
    58.             sDay = "Every Wednesday"
    59.         Case 5
    60.             sDay = "Every Thursday"
    61.         Case 6
    62.             sDay = "Every Friday"
    63.         Case 7
    64.             sDay = "Every Saturday"
    65.     End Select
    66.     Select Case oUP.Settings.ScheduledInstallationTime
    67.         Case 0
    68.             sTime = "12:00 AM"
    69.         Case Else
    70.             sTime = oUP.Settings.ScheduledInstallationTime & ":00"
    71.             sTime = Format(sTime, "hh:mm AMPM")
    72.     End Select
    73.     MsgBox "Service is " & sLevel & " for: " & vbNewLine & sDay & vbNewLine & sTime
    74.    
    75.     Set oUPSearcher = New UpdateSearcher
    76.     MsgBox "Searcher On-Line: " & oUPSearcher.Online
    77.    
    78.     Set oUPSearcher = Nothing
    79.     Set oUP = Nothing
    80.    
    81. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Re: WUAPI Help

    Thank you

    But the problem is when berforming the method search or began search
    it doesn't work well and also the install method

    try that

    thanks

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Re: WUAPI Help

    Where are you friends???

    No one can help me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width