Jump to content

Recommended Posts

Posted

Hello Everybody,

I have a .au3 script.I'm trying to compile this script(compinfo2.au3) by the following code(2 different scripts).Running these shows no error but the .au3 file is not compiled.Please someone help me.

;SCRIPT1

Local $LocationAut2Exe = @ProgramFilesDir &'\AutoIt3\Aut2Exe\Aut2Exe.exe'

Run(' "C:\Users\pradeep\Desktop\compInfo2.au3' & $LocationAut2Exe & 'C:\Users\pradeep\Desktop\compInfo2.exe "?')

;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

;SCRIPT2

ShellExecute ( @ScriptDir & '\Aut2Exe\Aut2exe.exe', ' /in "' & @Scriptdir & '\compInfo2.au3" /comp 4' )

 

Posted (edited)
;SCRIPT1
$sPathAut2Exe = @ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exe.exe"
If Not FileExists($sPathAut2Exe) Then MsgBox(4096, "Error", "Aut2Exe not found")
$sScript = @DesktopDir & '\compInfo2.au3'
If Not FileExists($sScript) Then MsgBox(4096, "Error", "Script not found")

Run(@AutoItExe & " " & $sScript) ;Runs compInfo2.au3(not compiled) and script compInfo2.au3 will compile the script

 

;SCRIPT2 = @DesktopDir & '\compInfo2.au3'
$sPathAut2Exe = @ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exe.exe"
If Not FileExists($sPathAut2Exe) Then MsgBox(4096, "Error", "Aut2Exe not found")
$sScript = @DesktopDir & '\compInfo2.au3'
If Not FileExists($sScript) Then MsgBox(4096, "Error", "Script not found")

If Not @Compiled Then
    Run($sPathAut2Exe & ' /IN "' & $sScript & '" /COMP 4')
Else
    MsgBox(4096, "Ops", "I'm already compiled!")
EndIf

 

Edited by ThioFoX
Posted

Hi,

Thanks for your reply.I have this script compInfo2.au3 om the desktop, which I want to compile programatically.

The compiler(Auto2Exe.exe) is at ---->Program Files\Autoit3\Auto2Exe\Auto2Exe.exe.

Script1 is just running compInfo2.au3 and outputs the results,but not compiling it.

Script2 as shown below(of TheoFox) is working perfectly.

;SCRIPT2 = @DesktopDir & '\compInfo2.au3'
$sPathAut2Exe = @ProgramFilesDir & "\AutoIt3\Aut2Exe\Aut2exe.exe"
If Not FileExists($sPathAut2Exe) Then MsgBox(4096, "Error", "Aut2Exe not found")
$sScript = @DesktopDir & '\compInfo2.au3'
If Not FileExists($sScript) Then MsgBox(4096, "Error", "Script not found")

If Not @Compiled Then
    Run($sPathAut2Exe & ' /IN "' & $sScript & '" /COMP 4')
Else
    MsgBox(4096, "Ops", "I'm already compiled!")
EndIf

So issue may be considered resolved.

Thanks a lot TheoFox & Jos for all the help.

cheers

olmar

 

 

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
×
×
  • Create New...