Jump to content

I can't get AutoIt to run


Recommended Posts

I can't get AutoIt to run interactively or compiled.

I installed AutoIt ver. 3.3.14.5 in Windows 7 Professional 64bit  with all MS updates.

The AutoIt update check says it's 3.3.14.4.

I have windows defender turned off.

I have Bitdefender Antivirus configured in Antivirus Exceptions for the entire install folder.

I have Bitdefender Antivirus configured in Advanced Threat Defense exceptions for all AutoIt programs in the install folder.

I turned off Bitdefender.

When I edit a script and press F5 it doesn't run.  I get no errors.

In security for the install folder I assigned full control for the signed on user.

In security for the folder the script is in, I assigned full control for the signed on user.

I compiled the script.  It won't run as administrator.

Why can't I get AutoIt to run?

 

Thanks,

Docfxit

Link to post
Share on other sites
;AutoIt_Debugger_Command:Disable_Debug
Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 1) ;0=relative, 1=absolute(default), 2=client
Opt("PixelCoordMode", 1) ;0=relative, 1=absolute(default), 2=client
#include <AutoItConstants.au3>
AutoItSetOption("TrayIconDebug", 1) ;0-off
; Set so that tray displays current line number

Local $iFileExists = FileExists('C:\Dnload\9xAddons\Macrium\ReflectDLHF.exe')
If $iFileExists Then
    Run('C:\Dnload\9xAddons\Macrium\ReflectDLHF.exe')
Else
    Run('D:\Dnload\9xAddons\Macrium\ReflectDLHF.exe')
EndIf
Sleep(6000)
WinWait("Macrium Reflect Download Agent", " Download Location")
If Not WinActive("Macrium Reflect Download Agent", " Download Location") Then WinActivate("Macrium Reflect Download Agent", " Download Location")
WinWaitActive("Macrium Reflect Download Agent", " Download Location")
ControlClick("Macrium Reflect Download Agent", "", "Edit2") ;click Download button
Send("{CTRLDOWN}a{CTRLUP}C:\Dnload\9xAddons\Macrium\")
;AutoIt_Debugger_Command:Enable_Debug
WinWait("Macrium Reflect Download Agent", " Select Installation")
If Not WinActive("Macrium Reflect Download Agent", " Select Installation") Then WinActivate("Macrium Reflect Download Agent", " Select Installation")
WinWaitActive("Macrium Reflect Download Agent", " Select Installation")
ControlClick("Macrium Reflect Download Agent", "", "Button10")     ;click Download button
Sleep(200)
WinWait("Macrium Reflect Download Agent", "")
;WinWaitActive("Macrium Reflect Download Agent", "&Yes")
If WinExists("Macrium Reflect Download Agent") Then ;Macrium Reflect Download Agent File Exists
    ControlClick("Macrium Reflect Download Agent", "&Yes", "Button1") ;click Yes button
EndIf
;~ Script Compiled as 32-Bit to target both x86/x64 OS
#NoTrayIcon
#RequireAdmin
;~ Select the correct Msi based upon the OS Architecture
;Global $s7ZipMsi = @OSArch = "x64" ? @ScriptDir & "\7z1805-x64.msi" : @ScriptDir & "\7z1805.msi"

If @OSArch = "x64" Then
;~ Install 64-bit version for 64-bit OS Versions
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1)
EndIf
;        RunWait("MsiExec.exe /i " & $s7ZipMsi & " /QN RESTART=ReallySuppress")
WinWait("Macrium Reflect Installer", "Click 'Next' to extract the setup files and begin")
If Not WinActive("Macrium Reflect Installer", "Click 'Next' to extract the setup files and begin") Then WinActivate("Macrium Reflect Installer", "")
WinWaitActive("Macrium Reflect Installer", "Click 'Next' to extract the setup files and begin")
Sleep(5000)
ControlClick("Macrium Reflect Installer", "Click 'Next' to extract the setup files and begin", "&Next >")

GetHandle()

ControlCommand("Macrium Reflect Installer", "Click 'Next' to extract the setup files and begin", "Button2", "Check", "")
If @OSArch = "x64" Then
;~ Install 64-bit version for 64-bit OS Versions
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0)
EndIf
WinWait("Macrium Reflect", "Welcome to the Macri")
If Not WinActive("Macrium Reflect", "Welcome to the Macri") Then WinActivate("Macrium Reflect", "Welcome to the Macri")
WinWaitActive("Macrium Reflect", "Welcome to the Macri")
Send("{ENTER}")
WinWait("Macrium Reflect", "I &accept the terms ")
If Not WinActive("Macrium Reflect", "I &accept the terms ") Then WinActivate("Macrium Reflect", "I &accept the terms ")
WinWaitActive("Macrium Reflect", "I &accept the terms ")
Send("{UP}{ENTER}")
WinWait("Macrium Reflect", "Please enter your li")
If Not WinActive("Macrium Reflect", "Please enter your li") Then WinActivate("Macrium Reflect", "Please enter your li")
WinWaitActive("Macrium Reflect", "Please enter your li")
ControlClick("Macrium Reflect", "", "Button5")     ;click Home button to Activate
ControlClick("Macrium Reflect", "", "&Next >")
WinWait("Macrium Reflect", "")
If Not WinActive("Macrium Reflect", "") Then WinActivate("Macrium Reflect", "")
WinWaitActive("Macrium Reflect", "")
Send("{SPACE}{ENTER}")
WinWait("Macrium Reflect", "Install CBT (Not ava")
If Not WinActive("Macrium Reflect", "Install CBT (Not ava") Then WinActivate("Macrium Reflect", "Install CBT (Not ava")
WinWaitActive("Macrium Reflect", "Install CBT (Not ava")
Send("{ENTER}")
WinWait("Macrium Reflect", "The Setup Wizard is ")
If Not WinActive("Macrium Reflect", "The Setup Wizard is ") Then WinActivate("Macrium Reflect", "The Setup Wizard is ")
WinWaitActive("Macrium Reflect", "The Setup Wizard is ")
Send("{ENTER}")
WinWait("Macrium Reflect", "Launch Macrium Refle")
If Not WinActive("Macrium Reflect", "Launch Macrium Refle") Then WinActivate("Macrium Reflect", "Launch Macrium Refle")
WinWaitActive("Macrium Reflect", "Launch Macrium Refle")
Send("{SPACE}{ENTER}")
Local $iFileExists = FileExists("C:\Windows\UpdateMacriumRun.bat")
If $iFileExists Then FileDelete("C:\Windows\UpdateMacriumRun.bat")
$sMessage = "Update complete."
SplashTextOn("Title", $sMessage, -1, 100, -1, -1, $DLG_TEXTLEFT, "", 34)
Sleep(3000)
SplashOff()

Func GetHandle()
    Local $hHandle = WinGetHandle("Macrium Reflect Installer", "Click 'Next' to extract the setup files and begin")
    ConsoleWrite("$hHandle = " & $hHandle & @CRLF)
    WinActivate($hHandle)
    ControlClick($hHandle, "", "[CLASS:Button;INSTANCE:2]")
EndFunc   ;==>GetHandle

The script runs on other PC's. Both 32bit and 64bit.

 

Edited by Docfxit
Added a comment on the bottom.
Link to post
Share on other sites

I figured it out.

Folder "C:\Dnload\9xAddons\Macrium"

And Folder "D:\Dnload\9xAddons\Macrium"

Don't exist.

The script was on a WinWait.   I don't understand why there wasn't an icon in the system tray.

I don't know how to put up a message if both the folders don't exist.

I understand how to put a message for one but not both.

Thank you very much for looking at it.

Docfxit

Link to post
Share on other sites

You can use the following:

If FileExists('C:\Dnload\9xAddons\Macrium\ReflectDLHF.exe') Then
    Run('C:\Dnload\9xAddons\Macrium\ReflectDLHF.exe')
ElseIf FileExists('D:\Dnload\9xAddons\Macrium\ReflectDLHF.exe') Then
    Run('D:\Dnload\9xAddons\Macrium\ReflectDLHF.exe')
Else
    MsgBox(4096, "Error:", "Error: Unable to find ReflectDLHF.exe")
EndIf

 

Edited by Subz
Forgot to put Then on ElseIf line
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...