PRM Posted June 27, 2012 Share Posted June 27, 2012 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 More sharing options...
stormbreaker Posted June 27, 2012 Share Posted June 27, 2012 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 More sharing options...
PRM Posted June 27, 2012 Author Share Posted June 27, 2012 Hi MKISH, Can you provide example where your solution is used? Because right now it is not working in my case. Link to comment Share on other sites More sharing options...
PRM Posted June 27, 2012 Author Share Posted June 27, 2012 Can anybody answer this question? Link to comment Share on other sites More sharing options...
BrewManNH Posted June 27, 2012 Share Posted June 27, 2012 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 GudeHow 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 More sharing options...
PRM Posted June 28, 2012 Author Share Posted June 28, 2012 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 More sharing options...
BrewManNH Posted June 28, 2012 Share Posted June 28, 2012 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 GudeHow 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 More sharing options...
PRM Posted June 28, 2012 Author Share Posted June 28, 2012 #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 More sharing options...
PRM Posted June 28, 2012 Author Share Posted June 28, 2012 When I run this code proper test.exe is not created... Can you help? Link to comment Share on other sites More sharing options...
PRM Posted June 28, 2012 Author Share Posted June 28, 2012 "test.au3" is created.. 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