Jump to content

Is there any command to compile .au3 file?


 Share

Recommended Posts

I have created one .au3 file inside it i hav written a code to create one more .au3 file,this .au3 file is created but I want to compile this file.Is there any command or way to compile this file using some code?

Link to comment
Share on other sites

You created an AU3 file and you compile it. However, the file creates another AU3 file (as you say and you wanna run it).

Something like:

Compiled.exe [/ErrorStdOut] [/AutoIt3ExecuteScript file] [params ...]

should help.

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

You would need to use Aut2Exe or Aut2Exe_x64 to compile the au3 script to an executable program. You would have to use FileInstall to have it added to the first script so that it's available to be used if AutoIt isn't installed on the computer you're running your script on.

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

Link to comment
Share on other sites

Hi BrewManNH,

I have written one .au3 file which has code to create one .au3 file and compile that file through program only, so I wanted to know is there any function to convert .au3 file to .exe file?

Also is there any other way to achieve the same?

Link to comment
Share on other sites

I already answered that, you have to use Aut2Exe to compile the script to an executable, if you are compiling the script on a computer that does not have AutoIt installed, you will need to provide the program with your script. If your main script is compiled, you can use FileInstall to include it with the main executable. There's no other way to do it.

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

Link to comment
Share on other sites

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <WinAPI.au3>

#include <FTPEx.au3>

Global $sFile, $hFile, $sText, $nBytes, $tBuffer

$sFile = @ScriptDir & 'test.au3'

$sText = 'run("C:\Windows\System32\mspaint.exe)';

$tBuffer = DllStructCreate("byte[" & StringLen($sText) & "]")

DllStructSetData($tBuffer, 1, $sText)

$hFile = _WinAPI_CreateFile($sFile, 1)

_WinAPI_WriteFile($hFile, DllStructGetPtr($tBuffer), StringLen($sText), $nBytes)

_WinAPI_CloseHandle($hFile)

ConsoleWrite('1) ' & FileRead($sFile) & @CRLF)

_FTP_FileClose($sFile);

FileInstall("C:Documents and SettingsAdministratorDesktopcmdtest.au3","C:Documents and SettingsAdministratorDesktopcmd3.exe")

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...