Codyssey Posted March 14, 2014 Share Posted March 14, 2014 (edited) Hello, I've used AutoIt several years ago, and I want to use it again today for a new project. So I have installed the latest version on my Windows 7 machine. I have started to write a few simple scripts, build exe files and execute them. But each time I double-click the .exe file runs twice ! For example the "msgbox.au3" example provided with the installation files will display the text box a first time, then I click "Ok", and the text box shows up again. Here is the script : #include <Constants.au3> MsgBox($MB_SYSTEMMODAL, "AutoIt Example", "This is line 1" & @CRLF & "This is line 2" & @CRLF & "This is line 3") What is wrong ??? Edited March 14, 2014 by Codyssey Link to comment Share on other sites More sharing options...
JohnOne Posted March 14, 2014 Share Posted March 14, 2014 (edited) I see you specifically mention double-click. Is you os set up to run files with a single click? Edited March 14, 2014 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Codyssey Posted March 14, 2014 Author Share Posted March 14, 2014 No, I have to double-click to run a file. All alternative ways to run the file will cause a double execution : - select the file and press enter - run from a command line (msgbox.exe + enter) Link to comment Share on other sites More sharing options...
JohnOne Posted March 14, 2014 Share Posted March 14, 2014 (edited) Can you post whole script as it is, including name. Edited March 14, 2014 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Codyssey Posted March 14, 2014 Author Share Posted March 14, 2014 The script is : "C:\Program Files (x86)\AutoIt3\Examples\msgbox.au3" provided with AutoIt installation. It only contains the two lines I have written above, plus some comments : #include <Constants.au3> ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; Author: Jonathan Bennett (jon at autoitscript dot com) ; ; Script Function: ; Demo of using multiple lines in a message box ; ; Use the @CRLF macro to create a newline in a MsgBox - it is similar to the n in v2.64 MsgBox($MB_SYSTEMMODAL, "AutoIt Example", "This is line 1" & @CRLF & "This is line 2" & @CRLF & "This is line 3") However, the problem occurs with any script I have tried so far, so I think that the problem is related to AutoIt and/or my PC configuration. If I run the .au3 file (instead of the .exe file) from the AutoIt editor, it runs once. Link to comment Share on other sites More sharing options...
JohnOne Posted March 14, 2014 Share Posted March 14, 2014 weird, are you opening them from help file and directly compiling? if so, try creating a script in your docs folder or desktop. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Codyssey Posted March 14, 2014 Author Share Posted March 14, 2014 (edited) I had already copied the au3 file in a sub-folder of my docs folder. I have just tested AutoIt on another PC, and it did'nt have this problem. The most obvious difference between the two PC is the antivirius. So I tried to deactivate the antivirus (Avast) and ... it worked !!! Now I have to figure out why Avast Antivirus causes exe files created with Autoit to run twice... Edited March 14, 2014 by Codyssey Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now