Sign in to follow this  
Followers 0
noiseman

Embedded .exe and RunAs

5 posts in this topic

Dear All,

I'm new to AutoIt and I've already looked for it in the internet, but I could not find anything.

I have and application that must be executed under administrator credential. I know that it's possible, because I saw a guy doing it. I'd like to embed this .exe to a compiled script and run this embedded application using RunAs. So it's two questions.

1) How can I embed an .exe to a AutoIt script and create a final .exe (with the script and .exe inside) I need to add this .exe file to the scritp and them use the Aut2exe to create a final .exe file with the script and the .exe embedded.

2) How can I run this application using RunAs util. It must be added to the script. I just want to execute the compiled script and the application run without intervention.

Regards,

Share this post


Link to post
Share on other sites



search #include in the help file

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

FileInstall("C:\path\program.exe", @TempDir & "\program.exe")
RunAsWait(..., @TempDir  & "\program.exe")
FileDelete(@TempDir & "\program.exe")

Just a quick example.

@oMBra: #include is for script files, not executables.

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

I am also new to auto it and have been looking for a way to do this. Would you be willing to share the entire code with me.

raz

Dear All,

I'm new to AutoIt and I've already looked for it in the internet, but I could not find anything.

I have and application that must be executed under administrator credential. I know that it's possible, because I saw a guy doing it. I'd like to embed this .exe to a compiled script and run this embedded application using RunAs. So it's two questions.

1) How can I embed an .exe to a AutoIt script and create a final .exe (with the script and .exe inside) I need to add this .exe file to the scritp and them use the Aut2exe to create a final .exe file with the script and the .exe embedded.

2) How can I run this application using RunAs util. It must be added to the script. I just want to execute the compiled script and the application run without intervention.

Regards,

Share this post


Link to post
Share on other sites

Look at the FileInstall function and Richard's example in the post above yours, couldn't be easier. The file will be included/embedded in your compiled script.

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
Sign in to follow this  
Followers 0