Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Automate file download from Microsoft Update

Reply
 
Old 01-15-2009   #1 (permalink)


Vista 32bit
 
 

Automate file download from Microsoft Update

Hi.

I am installing several Windows 2003 severs and I want to update them before I connect them to internet. Therefore i need to update the servers offline. To do that I have to check what patches to install and then download them from windows update. To check what patches (over 40 patches)that are missing I use MBSA and write the output to a XML file. Then I move the XML file to a internetcomputer and use a vbscript to read the XML file to get the url to every patch needed and download them to a specified folder. My problem is the "File Download - Security Warning" and "Save as" windows you get when you download a KB123456.exe from windows update using internet explorer. Here is an example from the XML file
<DownloadURL>http://www.download.windowsupdate.co...82e4dc81ce.exe</DownloadURL>

I have searched internet for a good solution but I cant find any. I have managed to get a couple of the patches but it randomly stops working. And I think it is because I use appactivate and sendkeys, the only way I managed to work. But I guess thats the problem when I use that solution working with windows and simulating mouseclicks. I works for the first patch but when it loops back to next in line the problem starts. Here is the function for download i use in the script
HTML Code:
Function funcDownload_Patch
 Set IE = CreateObject("InternetExplorer.Application")
 IE.visible = 1
  IE.navigate( varUrl )
 Do Until Success1 = True
     Success1 = wshShell.AppActivate("File Download - Security Warning")
      Wscript.Sleep 1000
 Loop
 wshShell.appactivate("File Download - Security Warning")
 wshShell.SendKeys "%(S)" 
  Do Until Success2 = True
       Success2 = wshShell.AppActivate("Save as")
       Wscript.Sleep 1000
  Loop
 wshShell.appactivate("Save As") 
 wshShell.SendKeys "%(S)" 
 
 End function
But there must be a better way to do this, I hope anyway .

Can anyone help me with a better technicue?

Best regards
Twinnis

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
error code 80070663 when I tried to update microsoft .net framework 3.5 family update General Discussion
Automate https website file download? VB Script
Re: PS Script to automate checking date of file and delete if old PowerShell
Repeatedly Asked to update: Security Update for Microsoft XML Cor Vista security
Network Equipment Technologies Selects Microsoft Dynamics AX to Streamline and Automate Business Process Vista News


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46