Last active
April 20, 2016 14:20
-
-
Save dorukcan/686ef78c3ac894fc66aed7cb2e30a6b2 to your computer and use it in GitHub Desktop.
Runs windows update standalone files which have been downloaded by http://www.windowsupdatesdownloader.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <File.au3> | |
#RequireAdmin | |
Local $location = "C:\Users\dorukcan\Documents\Windows Updates Downloader\Non-Security Updates\" | |
Local $aFileList = _FileListToArray($location, "*") | |
For $i = 1 To $aFileList[0] | |
;open file | |
ShellExecute($location & $aFileList[$i]) | |
ConsoleWrite($i & " " & $aFileList[$i] & @CRLF) | |
;click ok to install | |
Local $okWin = WinWait("[TITLE:Windows Update Standalone Installer; CLASS:#32770]") | |
WinActivate($okWin) | |
Local $text = ControlGetText($okWin, "", "Static1") | |
ControlClick($okWin, "", "Button1") | |
If StringInStr($text, "already") Then | |
ProcessWaitClose("wusa.exe") | |
ContinueLoop | |
EndIf | |
;wait for installation done and close the window | |
Local $insWin = WinWait("Download and Install Updates", "Installation complete") | |
WinActivate($insWin) | |
ControlClick($insWin, "", "Button4") | |
;be sure about the previous process has been closed | |
ProcessWaitClose("wusa.exe") | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment