Jump to content
Sign in to follow this  

Script improvement

Recommended Posts


Hello guys. i whould like to know if someone can help me to do a proper script

Here is my script

; Script Start - Add your code below here
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <Word.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <ColorConstantS.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <ListViewConstants.au3>
#include <GuiListView.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <_IsUACAdmin.au3>

Opt("WinTitleMatchMode", 2)
Opt("WinTextMatchMode", 2)

MsgBox ( $MB_SYSTEMMODAL , "Reparation windows update", "La reparation va debuter")

 $file_loc = @ScriptDir & "\sources\1 Delete KEY REGEDIT AU.au3"

               If @Compiled = 1 Then
                  $file_exe = FileGetShortName(@AutoItExe & ' /AutoIt3ExecuteScript "' & $file_loc & '"')
                  $file_au3 = FileGetShortName($file_loc)
                  Run(@AutoItExe & " " & $file_au3, "", @SW_HIDE)

ShellExecute ( @ScriptDir & "\sources\3 WindowsUpdateAgent-7.6-x64.exe")
ShellExecute ( @ScriptDir & "\sources\4 windows6.1-kb3205394-x64_71d0c657d24bc852f074996c32987fb936c07774 OK.msu")

This working fine...

Now i am gonna add some KB install in silent mode.

But i whould like to use the error return can you guys give some exemple of how to do ?

Exemple I am gonna addd KB installation in quiet mode:

ShellExecute ( @ScriptDir & "\sources\7 - Windows6.1-KB3020369-x64 OK.msu /quiet /norestart")

How can i react with autoit with the return value of the installation of the KB ?


Exemple of return value :

1 Already installed

2 Not applicable on my system

3 installation failed


And react with the returned value. is that possible in the easyest way ?

Share this post

Link to post
Share on other sites

@JohnOne Ty for your answer i have no time yet to continu the devlopement of the script but in Two week  i am gonna get back to that script.


Can you explain at lest how that will help me to add error reading in my script and by witch way ?

Edit btw i have something like 12 command in powershell and i dont need to wait since it wont luch the second command before the first one is not returning a vlue so i dont even get how that gonna help


EDIT2 after watching the help file i may understand now why you say that.

i am gonna reformulate the question later ;).

Edited by caramen

Share this post

Link to post
Share on other sites


Switch ShellExecuteWait ( @ScriptDir & "\sources\7 - Windows6.1-KB3020369-x64 OK.msu /quiet /norestart")
    Case 1
        ;Already installed code
    Case 2
        ;N/A code
    case 3
        ;failed code


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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