Jump to content
4891gesp

Autoit convert to exe, the executable works only once - (Moved)

Recommended Posts

Hi,

i recorded a mouse click in a windows.

i converted to exe file.

It works the file time.

The second it doesn't.

If i continue to try a third time then windows 10 is sucked and i have to reboot.

I've already seen this problem in 2017 and i still have the same probleme.

Is there a solution for this issue?

Thank you

 

Share this post


Link to post
Share on other sites

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

@4891gesp You need to post your code, so we can see what you are doing, along with a detailed description of your goal. MouseClicks are inherently unstable; there is more than likely a better way to accomplish what you are after.


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

Hi,

 

this is the script:

#region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=00011009)  ---

#region --- Internal functions Au3Recorder Start ---
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '')
If $aResult[1] <> '00011009' Then
  MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00011009->' & $aResult[1] & ')')
EndIf

EndFunc

Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc

_AU3RecordSetup()
#endregion --- Internal functions Au3Recorder End ---

_WinWaitActivate("Nouvel onglet - Google Chrome","Chrome Legacy Window")
MouseClick("left",301,52,1)
Send("{CTRLDOWN}v{CTRLUP}{ENTER}")
_WinWaitActivate("https://spfondation.dev.descartes.com/affwebservices/secure/t/oidcpdc?response_typ****","Chrome Legacy Window")
MouseClick("left",912,166,1)
Send("{SHIFTDOWN}dtq{SHIFTUP}1482")
MouseClick("left",930,210,1)
Send("{SHIFTDOWN}p{SHIFTUP}pass***123")
MouseClick("left",1041,275,1)
_WinWaitActivate("Descartes 2.0 CHS - Google Chrome","Chrome Legacy Window")
MouseClick("left",1802,92,1)
#endregion --- Au3Recorder generated code End ---

 

With this script i used the conversion utility from Autoit then i have an exe file.

 

Share this post


Link to post
Share on other sites

What i'm trying is to:

click in a pop window.

click in username field and type the usernam

click in password field then type the password

click in submit button

that's all.

Share this post


Link to post
Share on other sites

Send("{CTRLDOWN}v{CTRLUP}{ENTER}") is fine, you are pasting.
Send("{SHIFTDOWN}dtq{SHIFTUP}1482") is not needed as such, it should be Send("DTQ1482").

the constant _WinWaitActivate("title changing sthing")  is not useful. Get the handle and use that, instead of the title string.

I would also use WinMove() to make sure the x,y are where they are expected.

...I guess that's that. Hope it helps.

Share this post


Link to post
Share on other sites
13 hours ago, 4891gesp said:

Is there a solution for this issue?

Yes, use WebDriver UDF instead of those unsecured Send and MouseClick

Share this post


Link to post
Share on other sites

Follow the installation steps.  There is a demo script that shows multiple examples of how to use the UDF.

 

Share this post


Link to post
Share on other sites

Hi,

i followed the documentation, once again when i execute the executable file after ompilation it crashes windows 10 exactly as in 2017.

Same when i try with sample file to open notepad, it opens notepad then windows10 crashes immediately.

But this time i needed to re-insall my win10 and i backup all data etc...

There is something wrong in the executable file or even if i run from editor i have the same result.

Something is not right.

But thank you for your help.

 

Share this post


Link to post
Share on other sites
13 minutes ago, 4891gesp said:

There is something wrong in the executable file or even if i run from editor i have the same result.

So you are re-installing win10 and then reinstalling the latest stable release from autoit.

Regardless of what was causing your crashing before, I am quite confident that if your machine crashes then it’s due to your script.

Did you ever run any other autoit scripts successfully, esp. sample programs?


Code hard, but don’t hard code...

Share this post


Link to post
Share on other sites

@JockoDundee i never succeed to run autoit compiled file (.exe)

it works once then it crashes everytime.

Yes i had to re-install win10 today but in 2017 i had to re-install win7.

With win10 i have only the basic windows protection.

 

@Danp2 Let me check but im afraid to crash again my computer.

With my organization i have a dev machine, i m affraid to crash their computer and it 's have all anti-virus.

That's why i'm trying with my personal pc.

 

 

Share this post


Link to post
Share on other sites

1- i go to this website to test:

https://ps.uci.edu/~franklin/doc/file_upload.html

 

2- i launch this script

ControlFocus("Open","","Edit")
ControlSetText("Open","","Edit","C:\Users\me\Downloads\DSC_0392.JPG")
ControlClick("Open","","Button1")

 

It should open the file location and then select the file and click open

It happens nothing then it crashes.

I m not able to see log file for errors.

im sure to do something wrong here.

 

If i try the sample to open notepad, it works then it crashes.

 

Share this post


Link to post
Share on other sites
Posted (edited)

Maybe don't compile it to an executable (exe) then. Try using: #AutoIt3Wrapper_OutFile_Type=a3x at the top of your script. Then associate the a3x file format with the AutoIt3 executable. I've successfully avoided the antivirus in a locked down corporate environment for two years like this

Edit: See Musashi's link below for a much more detailed explanation :)

Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts

Share this post


Link to post
Share on other sites
45 minutes ago, seadoggie01 said:

Maybe don't compile it to an executable (exe) then. Try using: #AutoIt3Wrapper_OutFile_Type=a3x at the top of your script.

https://www.autoitscript.com/forum/topic/34658-are-my-autoit-exes-really-infected/?do=findComment&comment=1472906

 


Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...