Jump to content

/AutoIt3ExecuteScript and #include issues


kor
 Share

Recommended Posts

sample line from compiled script

RunAsWait($sAdminUser, $sDomain, $sAdminPass, 0, @AutoItExe & " /AutoIt3ExecuteScript " & $sSysVolDir & "\ITInfo\ITInfoLogin.au3", @ProgramFilesDir & "\AutoIt3", @SW_HIDE)

Code for ITInfoLogin

#NoTrayIcon
#include "C:\Program Files\AutoIt3\Include\File.au3"
#include "C:\Program Files\AutoIt3\Include\Array.au3"

It's not working. I've searched and tried to read up on what is going on. All I can find are people saying I need to use FileInstall. Is there not a way I can just point the include path to the exact directory where the includes are?

Edited by kor
Link to comment
Share on other sites

I dunno might be related to your issue...

The filename of the current script to include. Path is optional. This must be a string--it cannot be a variable.

If "..." is used, the filename is taken to be relative to the current script.

If <...> is used the filename is taken to be relative to include library directory (usually C:\Program Files\AutoIt3\Include). The include library contains many pre-written user-functions for you to use!

A note about using the /AutoIt3ExecuteScript option. Since the standard library is searched for in the current interpreter's directory, the standard library functions will not be found; that library will only be found when run through AutoIt3.exe. It's recommended that you compile a script to the .a3x format before attempting to run it with /AutoIt3ExecuteScript.

Edited by MrMitchell
Link to comment
Share on other sites

I dunno might be related to your issue...

The filename of the current script to include. Path is optional. This must be a string--it cannot be a variable.

If "..." is used, the filename is taken to be relative to the current script.

If <...> is used the filename is taken to be relative to include library directory (usually C:\Program Files\AutoIt3\Include). The include library contains many pre-written user-functions for you to use!

A note about using the /AutoIt3ExecuteScript option. Since the standard library is searched for in the current interpreter's directory, the standard library functions will not be found; that library will only be found when run through AutoIt3.exe. It's recommended that you compile a script to the .a3x format before attempting to run it with /AutoIt3ExecuteScript.

Yes, that is taken from the help. I've read that already. I don't want to compile the scripts into a3x. i want to be able to simply point the include path to a literal directory on the client from which the script is executing. All clients already have autoit installed, so there is no concern of the include files not being present.
Link to comment
Share on other sites

One solution would be to run obfuscator with the striponly option. This spits out a file with all used constants and functions without using include lines. Other than that I don't know.

I'd do some tests, but portal2 is calling again.

Link to comment
Share on other sites

Nevermind. I figured out what the problem was. Using the literal path works when executing the script from the network share. But during my testing I was executing it from a local drive so I see now why it wasn't working. The above code works both with quotes and brackets for the include.

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...