Sign in to follow this  
Followers 0
blakel

Opinions, Help, Debug, Improve

3 posts in this topic

#1 ·  Posted (edited)

I have just finished the first version of a windows update script. I hope to eventually have it robust enough to use in production at work, but that will take a lot of work.

Any feedback is welcome.

Excuse my poor auto-it skills.

I thought i would go ahead and post it in case someone was interested and might find it useful.

Warning: I have only run it twice!

;winupdate.au3
;Windows Update Script
;AutoIt v3.0.101
;Written for WU v4
;Tested on W2kSP4

;To-Do: Run Hidden
;To-Do: Runasset
Run("c:\program files\internet explorer\iexplore.exe [url=http://v4.windowsupdate.microsoft.com/en/default.asp")]http://v4.windowsupdate.microsoft.com/en/default.asp")[/url]

If WinWait("Microsoft Windows Update","",15) <> 1 Then Exit(1)
Do
 Sleep(100)
Until StatusBarGetText("Microsoft Windows Update") = 'Done'
Sleep(1000)

;To-Do: react to need for newer WU version

;File->open->blah: prevent ambiguity of Edit1,Edit2 of address bar & Google search
ControlSend("Microsoft Windows Update","","Internet Explorer_Server1","^o",0)
Sleep(100)
ControlSend("Open","","Edit1","javascript:parent.fnScan();",1)
ControlSend("Open","","Edit1","{ENTER}",0)
;To-Do: Tweak this sleep amount
Sleep(30 * 1000)

ControlSend("Microsoft Windows Update","","Internet Explorer_Server1","^o",0)
Sleep(100)
ControlSend("Open","","Edit1","javascript:parent.fnDisplayBasketUpdates();",1)
ControlSend("Open","","Edit1","{ENTER}",0)
Sleep(5 * 1000)

ControlSend("Microsoft Windows Update","","Internet Explorer_Server1","^o",0)
Sleep(100)
ControlSend("Open","","Edit1","javascript:parent.fnInstall();",1)
ControlSend("Open","","Edit1","{ENTER}",0)
Sleep(5 * 1000)

;Wait for updates to finish downloading / installing if any
;To-Do: if possible, show this dialog w/ disabled cancel button
;Note: With call of fnInstall() this dialog always shows up
;     and causes a non-critical error if no updates.
;     maybe test for active cancel button immediately?
If WinWait("Windows Update -- Web Page Dialog","",20) <> 1 Then Exit(0)
;To-Do: Tweak timeout amount
WinWaitClose("Windows Update -- Web Page Dialog","",(20 * 60))
;To-Do: react to window "Microsoft GDI+ Detection Tool" x2

;Restart?
;Title: "Microsoft Internet Explorer"
;Text: "You must restart your computer to complete the installation."
;Text: "If you want to restart later, or close other programs first, click Cancel, and then restart your computer manually."
;Text: "Do you want to restart now?"
;If WinExists("") = 0 Then Exit(0)
Edited by blakel

Share this post


Link to post
Share on other sites



Does this work on the new version (5) of windows update for Windows XP as well?

Another set of windows you may need to react to is the installation of Internet Explorer or DirectX and ActiveX installation confirmation.


Who else would I be?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Does this work on the new version (5) of windows update for Windows XP as well?

Another set of windows you may need to react to is the installation of Internet Explorer or DirectX and ActiveX installation confirmation.

<{POST_SNAPBACK}>

WU5 probably not, as the function calls might have changed.

XP probably, don't see why not, it is IE

directx [and activex ?] are optional for inital install form WU, although

their updates should be fine.

this is mostly for the exploit of the week.

installs (maj ver changes) of IE AX DX SPx will be done with a dedicated script anyhow

Edited by blakel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0