Jump to content
Sign in to follow this  
Techline2012

AutoIT Script not running when compiled for x86

Recommended Posts

Techline2012

Hey everyone, the issue I am having is hopefully a trivial one. I have created a script, which I will post below, that automates a particular virus removal program. If I run the .au3 script (x86 or x64), it works perfectly. If I compile the script for x64, it runs perfectly. How come when I compile it for compatibility with x32 it will get stuck on the last part where I send the "Enter" command. It will not do it either time, although when I run the script or compiled x64 version it works fine. Is there something I am missing? How can I get this to run on x32 machines? 

#RequireAdmin

Opt("WinTitleMatchMode",2)
Opt("TrayIconDebug",1)

Run("Combofix.exe")

Do
   sleep(100)
Until WinExists("ComboFix: Disclaimer", "Please review the disclaimer before running ComboFix. You should disable your antivirus programs before proceeding.") or WinExists("ComboFix", "There")

If WinExists("ComboFix", "There") Then

   WinWait("ComboFix", "There")
   WinActivate("ComboFix", "There")
   WinWaitActive("ComboFix", "There")
   ControlClick("ComboFix", "There", "[CLASS:Button; INSTANCE:1]")

EndIf



If WinExists("ComboFix: Disclaimer", "Please review the disclaimer before running ComboFix. You should disable your antivirus programs before proceeding.") Then

   WinWait("ComboFix: Disclaimer", "Please review the disclaimer before running ComboFix. You should disable your antivirus programs before proceeding.")
   WinActivate("ComboFix: Disclaimer", "Please review the disclaimer before running ComboFix. You should disable your antivirus programs before proceeding.")
   WinWaitActive("ComboFix: Disclaimer", "Please review the disclaimer before running ComboFix. You should disable your antivirus programs before proceeding.")
   ControlClick("ComboFix: Disclaimer", "Please review the disclaimer before running ComboFix. You should disable your antivirus programs before proceeding.", "[CLASS:Button; INSTANCE:2]")

EndIf

Do
   sleep(100)
Until WinExists("Warning") or WinExists("Administrator")

If WinExists("Warning") Then

   WinWait("Warning")
   WinActivate("Warning")
   WinWaitActive("Warning")
   Send("{ENTER}")

   WinWait("Warning")
   WinActivate("Warning")
   WinWaitActive("Warning")
   Send("{ENTER}")

EndIf

(It crashes at the point it says "If WinExists("Warning") then" ....etc

 

Any help is greatly appreciated. Thanks!

Share this post


Link to post
Share on other sites
BrewManNH

Define "crashes".

Does it give you an error message, does it exit the script, does it hang, does it blue screen the computer? 

Crashes is a very vague problem description that could imply anything and everything.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Techline2012

@BrewManNH

I'm not quite sure. I assume exit, because the icon is not shown in the notification bar anymore. I don't get a message or anything, I just get stuck at the window where autoIT should be sending "Enter". The script disappears from the notification bar, and I have to exit the application.

Share this post


Link to post
Share on other sites
BrewManNH

Is the window displaying the warning or the Administrator title? Because you only coded for the warning and not the administrator.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Techline2012

It gets stuck at the "Warning" window. Once it hits "Administrator" the script ends. This is how it should be. The situation is that I will either get the warning window or administrator window depending on a couple of variables. If it hits warning, it needs to send enter. The window then pops up again, and again it needs to send enter. Then administrator will pop up, and the script will (should) close, which it does. There is no problem with the logic of my code: I've seen it work multiple times. As long as it is not compiled for x32 machines it will run. 

Share this post


Link to post
Share on other sites
BrewManNH

Don't compile it for x64 if it's not needed. The 32 bit version should work on an x64 OS, so unless it's absolutely necessary to compile it that way, you probably don't need to.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Techline2012

My point exactly. But can you see my issue. I WANT to compile it for x32, but when I do the script stops at the WARNING window. When I compile it for x64 it DOES work. I can also click Run Script x32 or Run Script x64, and these both WORK. Why will my script not work when I compile it for x32, and then proceed to run the .exe?

Share this post


Link to post
Share on other sites
ddxfish

I have actually automated ComboFix in a larger tool using AutoIt in the past month. I cannot imagine your code can finish the CF run.

Your script is not crashing, ComboFix is killing it. Combofix has killed off my repair tools for a long time, so you cannot automate ComboFix like you want to.

Share this post


Link to post
Share on other sites
Techline2012

So how come it only kills the x32 version and not the x64 version? Once I get to the administrator command window, I can have the script close because the only two possible outcomes are 1) Restart and 2) Bring up Log file. I just need it to send enter those two times, and I can finish the script. 

If combo fix is killing my script, why will it only kill the x32 version. Thats the main problem it looks like.

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  

×