Jump to content

sabbas

Members
  • Posts

    2
  • Joined

  • Last visited

sabbas's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi Dan, Thank you very much for your contribution. Special thanks for adding comments! I started working on my script using your code as a base. After 4 days, I've reached the 'form' that I need for my script. Now, I need you or other generous people's help to bring 'function' 1. I don't want current file to be shown as 'CurrentFolderCurrentFile'. Is there a way I can show only 'CurrentFile'? 2. I want the process to check if the filename contains KB* with a - before and after. For example, Windows6.1-KB2670838-x64.exe. It should check for KB2670838 in filename and otherwise skip that file even if it has MSU or EXE extension 3. I want a progress bar, if possible. Not necessary 4. status of the updates after they are run written to a file. errors to one file and success to another using success.datetime.txt and error.datetime.txt #include <FileParts.au3> #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> ; Scan Script Folder Recursively and Generate File List Array for files with extenstion MSU and EXE $uFile = _FileListToArrayRec(@ScriptDir, "*.msu;*.exe", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT) ; Check if the Folder or File Actually Exist If @error = 1 Then MsgBox (48+1, "Error!", "Folder does not exist!", 0) Exit EndIf If @error = 4 Then MsgBox (48+1, "Error!", "Files don't exist!", 0) Exit EndIf ; Setup a general splash screen that will show the current update being installed SplashTextOn("Installing Update...", "", 500, 100, -1, -1, 0, "", 14, 500) ; loop through the number of files from the array For $u = 1 To $uFile[0] ;check for extension match If StringRight($uFile[$u], 3) = "msu" Then ;rewrite splash screen with the current file being processed ControlSetText ("Installing Update...", "", "Static1", $uFile[$u]) ;Execute the selected file RunWait(@SystemDir & "\wusa.exe " &@WorkingDir&"\"&$uFile[$u]& " /quiet /norestart") ElseIf StringRight($uFile[$u], 3) = "exe" Then ControlSetText ("Installing Update...", "", "Static1", $uFile[$u]) RunWait(@SystemDir & "\wusa.exe " &@WorkingDir&"\"&$uFile[$u]& " /q /norestart") Else ControlSetText ("Installing Update...", "", "Static1", $uFile[$u] & " is not a valid update!") EndIf Next ; switch off the splash screen SplashOff() Thank you. with warm regards, Shereef
  2. I've the following batch file that I use to update windows machines manually: REM Internet Explorer 11 Installation Script Updated 25/01/2015 @ECHO OFF SET IE11=D:\TEMP\Updates\IE11 SET Important=D:\TEMP\Updates\Important SET Optional=D:\TEMP\Updates\Optional For %%u in ("%IE11%\*.msu") Do ( ECHO Installing Update: %%u ECHO START /WAIT wusa "%%u" /quiet /norestart ) Echo Internet Explorer 11 Prerequisites Finished. ECHO ............................................ ECHO Installing Internet Explorer 11 START /WAIT wusa "%IE11%\IE11-Windows6.1-x64-en-us.exe" /quiet /norestart Pause Exit Could someone please help me convert this into a "managable" script? I say managable because I want this to be a starting point for me learning AuotIT. So if you can add comments as to what's happening in your script, that would be greatly appreciated. Thank you all and especially the creators! regards, Shereef
×
×
  • Create New...