Groups > Microsoft > Microsoft Softwareupdates services > installing updates from wsusscn2 to xp from local file server




installing updates from wsusscn2 to xp from local file
server

installing updates from wsusscn2 to xp from local file server
Mon, 14 Apr 2008 06:50:00 -070
I have a script that is suppose to run automatic updates from the local 
wsuscab and install the updates from that cab on a local file server. It  
scans and downloads the updates but doesn't install, giving error number 4. 
In windows update log it reads Windows failed to install the following update 
with error 0x80246007: 
thanks for any help. 
Script is 

Set UpdateSession = CreateObject("Microsoft.Update.Session") 
Set UpdateServiceManager =
CreateObject("Microsoft.Update.ServiceManager") 
Set UpdateService = UpdateServiceManager.AddScanPackageService("Offline
Sync 
Service", "c:\wsusscn2.cab") 
Set UpdateSearcher = UpdateSession.CreateUpdateSearcher() 
'Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl") 
WScript.Echo "Searching for updates..." & vbCRLF 
UpdateSearcher.ServerSelection = 3 
UpdateSearcher.ServiceID = UpdateService.ServiceID 
Set SearchResult = UpdateSearcher.Search("IsInstalled=0") 
Set Updates = SearchResult.Updates 
If searchResult.Updates.Count = 0 Then 
  WScript.Echo "There are no applicable updates." 
  WScript.Quit 
End If 

'20 
WScript.Echo "List of applicable items on the machine when using 
wssuscan.cab:" & vbCRLF 
'*******************************************************************************

WScript.Echo vbCRLF & "Downloading updates..." 

'*******************************************************************************

Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl") 
For I = 0 To searchResult.Updates.Count-1 
  set update = searchResult.Updates.Item(I) 
     WScript.Echo I + 1 & " adding:  " & update.Title 
     updatesToInstall.Add(update)  
  
Next 
'WScript.Echo "List of updates:" & updatesToInstall 
'******************************************************************************

'39 
WScript.Echo "Installing updates..." 
Set installer = updateSession.CreateUpdateInstaller() 
installer.Updates = updatesToInstall 
      Set installationResult = installer.Install() 
Wscript.echo " Close 2"  
For I = 0 to updatesToInstall.Count - 1 
WScript.Echo I + 1 & "> " & _ 
updatesToInstall.Item(i).Title & _ 
": " & installationResult.GetUpdateResult(i).ResultCode 
Next 
'Output results of install 
WScript.Echo "Installation Result: " &
installationResult.ResultCode 
WScript.Echo "Reboot Required: " &
installationResult.RebootRequired & 
vbCRLF     

Post Reply
about | contact