none
Windows Update skript stiahne aktualizacie, ale nenainstaluje

    Dotaz

  • Zdravim,

    pouzivam k instalacii novych PC visual basic skript, ktory stiahne vsetky aktualizacie a rovno ich aj nainstaluje.. Z nicoho nic, mi tento skript prestal fungovat..

    Skript vypise chybu : Chyba pri behu programu: Neplatne volani nebo argument procedury.

    Chybovy riadok odkazuje na :  Set installationResult = installer.Install() - teda prikaz k instalacii

    windowsupdate.log nasledne ukazuje trochu zaujimavejsie data :

    011-06-17 15:49:16:062 1080 3fc Agent  * WARNING: Exit code = 0x80070057
    2011-06-17 15:49:16:062 1080 3fc Agent *********
    2011-06-17 15:49:16:062 1080 3fc Agent ** END ** Agent: Installing updates [CallerId = ]
    2011-06-17 15:49:16:062 1080 3fc Agent *************
    2011-06-17 15:49:16:062 1080 3fc Agent WARNING: WU client failed installing updates with error 0x80070057
    2011-06-17 15:49:16:078 2064 c34 COMAPI >>-- RESUMED -- COMAPI: Install [ClientId = <NULL>]
    2011-06-17 15:49:16:078 2064 c34 COMAPI  - Install call failed
    2011-06-17 15:49:16:078 2064 c34 COMAPI  - Reboot required = No
    2011-06-17 15:49:16:078 2064 924 COMAPI WARNING: Operation failed due to earlier error, hr=80070057
    2011-06-17 15:49:16:078 2064 c34 COMAPI  - WARNING: Exit code = 0x80240FFF; Call error code = 0x80070057
    2011-06-17 15:49:16:078 2064 924 COMAPI FATAL: Unable to perform synchronous installation successfully. (hr=80070057)
    2011-06-17 15:49:16:078 2064 c34 COMAPI ---------
    2011-06-17 15:49:16:078 2064 c34 COMAPI -- END -- COMAPI: Install [ClientId = <NULL>]
    2011-06-17 15:49:16:078 2064 c34 COMAPI -------------

    - mam nainstalovany windowsupdate agent v3.0 (najnovsi)

    Skusal som spustit i orginal skript zo stranok MS : http://msdn.microsoft.com/en-us/library/aa387102(v=VS.85).aspx - rovnaka chyba..

     

    Updaty su v stiahnute v SoftwareDistribution, skusal som zastavit sluzbu AutoUpdate, vymazat slozku a spustit to znova, bohuzial bez uspechu..

     

    Nejaka rada?? Diky

    pátek 17. června 2011 14:04

Odpovědi

  • Problem vyrieseny...

    pred spustenim skriptu je nutne povolit v systeme Automaticke aktualizacie..

    zase pomocou skriptu:

    Const AU_LEVEL = 2
    
    Set objAutoUpdate 	= CreateObject("Microsoft.Update.AutoUpdate")
    Set objSettings		= objAutoUpdate.Settings
    
    objSettings.Notificationlevel = AU_LEVEL
    objSettings.Save
    


     Jedna vec, ktoru nechapem je to.. preco hore uvedeny skript este pred mesiacom bez problemov fungoval a z nicoho nic fungovat prestal..

    P.S.: Ani instalacia po castiach nepomohla.. Skusal som registrovat DLL, preinstalovat WUA, restartovat sluzby.. Stacilo ale povolit AU a hned sa to rozbehlo.. :)

    Zucastnenym diky za snahu

    • Označen jako odpověď kiklop úterý 21. června 2011 8:48
    úterý 21. června 2011 8:48

Všechny reakce

  • No a rucne spustit tu aktualizaci jde? S jakym výsledkem?

     

    Muzete sem hodit ten skript kterym to delate? Zkousel stejny skript i na jinych OS?


    ing. Jan Chaloupek
    pátek 17. června 2011 14:34
  • Pri  instalaci vetsiho poctu aktualizaci muze system skoncit aktualizaci s vyse uvedenou chybou. Resenim je   http://support.microsoft.com/kb/949104/en-us  Druhym resenim je instalace po castech.

     

    Pod carou: Chyba se vyskytuje take v souvislosti s

    1. Programem Netop

    2. Drivery tiskarny OKI

    Update programu a driveru muze byt resenim

    Pro jistotu jeste zastavte cinnost AV programu.

    Protoze nepisete, jaka je vychozi verze W XP, pak jeste upozornuji na nutnost odinstalace nekterych programu a aktualizaci, pro SP 2 > SP 3 to je IE8 a KB925877)


    pátek 17. června 2011 16:19
    Moderátor
  • pripajam cely skript..

    function MSUpdate()
      Dim shell, AllUsersStartMenu, ServiceManager
    
    
      Set ServiceManager = CreateObject("Microsoft.Update.ServiceManager")
      ServiceManager.ClientApplicationID = "My App"
      'add the Microsoft Update Service, GUID
      Set NewUpdateService = ServiceManager.AddService2("7971f918-a847-4430-9279-4a52d1efe18d",7,"")
      Set filesys = CreateObject("Scripting.FileSystemObject") 
     
    end function 
    
    wscript.echo "Upgrading to Microsoft Update..."
    MSUpdate()
    
    
    
    Dim objfso, objtf
    set objfso = CreateObject("Scripting.FileSystemObject")
    set objfile = objfso.OpenTextFile("preinstall.log", 8,true,TristateUseDefault)
    
    
    Set updateSession = CreateObject("Microsoft.Update.Session")
    Set updateSearcher = updateSession.CreateupdateSearcher()
    Dim hidden, article
    
    Dim HideCount, SkipCount, SuccessCount, FailCount
    HideCount    = 0
    SkipCount    = 0
    SuccessCount  = 0
    FailCount    = 0
    
    hidden = Array("976002","944036")
    skipped = Array("891230","940157","905474","2267621","931125","0",""," ")
    ' obrazkovka, IE8
    ' WGA, WinSearch4, WGA2, EssSecurity, LiveEssent,Uknown
    
    WScript.Echo "Looking for new updates..." & vbCRLF
    objfile.WriteLine("Looking for new updates..." & vbCRLF)
    Set searchResult = updateSearcher.Search("IsInstalled=0 and IsHidden=0")
    
    
    If searchResult.Updates.Count = 0 Then
    	WScript.Echo "No new updates. Exiting..."
      objfile.writeline("No new updates.")
      objfile.close()
    	WScript.Quit
    else
      WScript.Echo "New updates were found ("& searchResult.Updates.Count &")" & vbCRLF
      objfile.writeline("New updates were found ("& searchResult.Updates.Count &")"& vbCRLF )
      For I = 0 To searchResult.Updates.Count-1
        Set update = searchResult.Updates.Item(I)
        For Each strArticle in update.KBArticleIDs
          article = update.KBArticleIDs(0)
        Next
        WScript.Echo I + 1 & "> "& article
        wscript.echo " > "& update.Title & vbCRLF
      Next
    End If
    
    WScript.Echo vbCRLF & "Creating collection of updates to download:"
    
    Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
    
    For I = 0 to searchResult.Updates.Count-1
      skip = 0
      hide = 0
      article = 0
      Set update = searchResult.Updates.Item(I)
      For Each strArticle in update.KBArticleIDs
        article = update.KBArticleIDs(0)
      Next
      for each a in hidden
        If a = article Then
          hide = 1
          HideCount = HideCount + 1
        end if
      next
      for each a in skipped
        If a = article Then
          skip = 1
          SkipCount = SkipCount + 1
        End if
      next
      If skip = 1 Then
        WScript.Echo I + 1 & "> Skip : " & article
      else
        If hide = 1 Then
          WScript.Echo I + 1 & "> Skip & Hide :" & article 
          update.IsHidden = True
        else
          WScript.Echo I + 1 & "> Add : " & article
          updatesToDownload.Add(update)
        end if
      end if
      wscript.echo " > "& update.Title & vbCRLF
    Next
    
    WScript.Echo vbCRLF & "Downloading updates, Please wait..."
    
    
    Set downloader = updateSession.CreateUpdateDownloader() 
    Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")
    
    downloader.Updates = updatesToDownload
    downloader.Download()
    
    WScript.Echo vbCRLF & "List of downloaded updates:"
    
    For I = 0 To searchResult.Updates.Count-1
      Set update = searchResult.Updates.Item(I)
      If update.IsDownloaded Then
        article = 0
        Set update = searchResult.Updates.Item(I)
        For Each strArticle in update.KBArticleIDs
          article = update.KBArticleIDs(0)
        Next
        WScript.Echo I + 1 & " > "& article
        wscript.echo "  > "& update.Title & vbCRLF
    
        updatesToInstall.Add(update)	
    
      End If
    Next
    
    	WScript.Echo "Installing updates..."
    	Set installer = updateSession.CreateUpdateInstaller()
    	installer.Updates = updatesToInstall
    	Set installationResult = installer.Install()
    	
    	'Output results of install
    	
    	WScript.Echo "Listing of updates installed and individual installation results:" 
    	
    	For I = 0 to updatesToInstall.Count - 1
    		WScript.Echo I + 1 & "> "& installationResult.GetUpdateResult(i).ResultCode & ": "&updatesToInstall.Item(i).Title  		
    	    If installationResult.GetUpdateResult(i).ResultCode = 2 Then
        		  SuccessCount = SuccessCount + 1
    	    end if
    
    	    If installationResult.GetUpdateResult(i).ResultCode = 4 Then
        	  FailCount = FailCount + 1
    	    end if
    	Next
    
    
    objfile.writeline("--- Instllation Result: "& installationResult.ResultCode & vbCRLF)
    objfile.writeline("Reboot Required: " &installationResult.RebootRequired & vbCRLF)
    objfile.writeline("Succeeded : "& SuccessCount & vbCRLF)
    objfile.writeline("Failed : "& FailCount & vbCRLF)
    wscript.echo " "
    wscript.echo " "
    WScript.Echo "Installation Result  : "& installationResult.ResultCode 
    WScript.Echo "Reboot Required    : "& installationResult.RebootRequired & vbCRLF 
    wscript.echo "Hidden updates    : "& HideCount
    wscript.echo "Skipped updates    : "& (HideCount + SkipCount)
    wscript.echo "Succeeded       : "& SuccessCount
    wscript.echo "Failed        : "& FailCount
    objfile.close()
    
    If installationResult.RebootRequired = True Then
      Wscript.Quit(2)
    else
      If SuccessCount = 0 Then
        wscript.echo "Exiting (0)"
        Wscript.Quit(0)
      else
        wscript.echo "Exiting (1)"
        wscript.quit(1)
      end if
    End if
    


    System je WinXP s integrovanym SP3 (CZE)

    jedna sa o cistu instalaciu systemu.. Spravil som pokus a vynechal instalaciu antiviru, takze v instalacii by nemalo nic branit.. Postupujem totiz nasledovne:

    - instalacia WindowsInstaller 3.5, WindowsUpdate Agent 3.0, .NET 3.5, .NET 4, Software (Office, PDF, Antivir) nasledne pustim MS Update.., kazdy krok je oddeleny restartom.

    - Netop ani OKI nepouzivame..

    - Windows update z webovej stranky funguje (nasledne zacne zahadne fungovat aj skript..)

    pondělí 20. června 2011 7:02
  • Dobrý den,

     

    takže jak už psal pan Puchta mohlo by to být toto:

    Pri  instalaci vetsiho poctu aktualizaci muze system skoncit aktualizaci s vyse uvedenou chybou. Resenim je   http://support.microsoft.com/kb/949104/en-us  Druhym resenim je instalace po castech.


    ing. Jan Chaloupek
    pondělí 20. června 2011 10:56
  • Problem vyrieseny...

    pred spustenim skriptu je nutne povolit v systeme Automaticke aktualizacie..

    zase pomocou skriptu:

    Const AU_LEVEL = 2
    
    Set objAutoUpdate 	= CreateObject("Microsoft.Update.AutoUpdate")
    Set objSettings		= objAutoUpdate.Settings
    
    objSettings.Notificationlevel = AU_LEVEL
    objSettings.Save
    


     Jedna vec, ktoru nechapem je to.. preco hore uvedeny skript este pred mesiacom bez problemov fungoval a z nicoho nic fungovat prestal..

    P.S.: Ani instalacia po castiach nepomohla.. Skusal som registrovat DLL, preinstalovat WUA, restartovat sluzby.. Stacilo ale povolit AU a hned sa to rozbehlo.. :)

    Zucastnenym diky za snahu

    • Označen jako odpověď kiklop úterý 21. června 2011 8:48
    úterý 21. června 2011 8:48