Windows Update

This will show how to write a basic AutoIt program for installing windows updates.It consists of two files
1) UpdateTool.ini
2) The complied AutoIt Program

UpdateTool.ini

[CONFIG]
UPDATELOCATION=L:\setups\Kpu\ImagingUpdateTool\WindowsUpdatesHere\

AutoIt Script

$updatelocation = iniRead("UpdateTool.ini","CONFIG","updatelocation","")
$search = FileFindFirstFile($updatelocation & "*.exe")  
 
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf
While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    ;MsgBox(4096, "File:", $file)
	TrayTip("Installing", $file,5,1)
	RunWait(@ComSpec & " /c " & $updatelocation & $file & " /passive /norestart","",@SW_HIDE)
WEnd
FileClose($search)

Your rating: None Average: 5 (1 vote)