Sign in to follow this  
Followers 0
macp

Compiled script does not run under winpe 2

10 posts in this topic

Hi all,

I tried to run a compiled script with GUI under a winpe2 environment, and i got an Autoit error msgbox :). I ve searched in the forum and according to some topics it seems that it is possible to run autoit scripts under winpe. I think i should need to copy/register some dlls maybe ?

thanks for any help !

Share this post


Link to post
Share on other sites



Welcome,

And the details of the error?

Share this post


Link to post
Share on other sites

Nothing interresting actually :

Posted Image

I tryed to compile it with x64, x86, AINSI but still the same error :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I tried this for fun a few weeks ago, and got the message on line -1 that variable must be of type "object".

My guess is that AutoIt is dependent on Windows shared libraries, which are not available in WinPE (being a rather small OS). If you read the WinPE 2 documentation carefully, you'll see that it's designed to run most commandline-based program (think DOS consoles and interpreters). I don't think (though I could be wrong, and I'd sure like to know if I am) that you'll ever get an AutoIt script to run in WinPE.

As a side note though, I did discover that by copying mstsc* and <your language>\mstsc* out of System32 onto your WinPE disk allows you to successfully run Remote Desktop, which can in turn run anything that runs on Windows...maybe you can do something with that? Modify your WinPE image to automatically launch mstsc pointed at the desired computer and launch the desired app?

DISCLAIMER!! I'm not sure of the legality of copying mstsc from one computer to another...my guess is it's not. I was just trying it to see.

Edit: one final thought...I haven't tried it, but maybe you could use RemoteApp on the WinPE computer, if your script is located on a server...

Edit again: once again I proved myself wrong after I posted...seems that I could get some of my basic old scripts to run under WinPE (including some GUIs, which surprised me), but nothing I've written lately. I don't know if that's because of newer AutoIt versions, or if it's because my newer scripts tend to use the SQLite functions quite a bit... I'll be following this topic with you to learn what it takes to run in WinPE. :)

By way of troubleshooting, what #include files do you have in your script? Maybe some of the includes that require dlls (like the SQLite functions I tend to use) don't run correctly...

Edited by james3mg

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

I do use AutoIt under BartPE and Reatogo PE. Nothing fancy, just running a DOS based program, check if network drives are available, and copy files back and forth, but it does work fine with 3.2.8.1 and 3.2.10.0

Kerros


Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Share this post


Link to post
Share on other sites

Looks to me like regsvr32 isn't running well with most dlls under WinPE - I tried manually registering SQLite.dll and the ImageMagick dll I use a lot, and both failed. The SQLite.dll told me that the Entry-point DLLRegisterServer was not found, and to verify it was a valid dll or ocx file. The ImageMagick dll file told me I needed to debug it to check for problems with the binary or dependent dll files.

So maybe there are dependent objects that aren't registered in WinPE, or maybe these versions of the dlls don't run under WinPE. I'm going to look and try to find out if there are other files these objects are dependent on. Or maybe I need to register these dlls right into WinPE when I'm compiling the iso...

Do you have any functions that require COM objects? That might be your problem, though your error looks different than mine...


"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

Hi i finally solved my problem by copying autoit folder and running my script either by doing "autoit3.exe myscript.au3" or "autoit3.exe myscript.exe".

Regarding the error "variable must be of type "object" it is because you need to install a package (I dont remember which one by now ? maybe script support package ?) into your winpe image using peimg.exe tool.

More details here :

http://technet2.microsoft.com/WindowsVista...3.mspx?mfr=true

Thanks again for your help

Share this post


Link to post
Share on other sites

Hi i finally solved my problem by copying autoit folder and running my script either by doing "autoit3.exe myscript.au3" or "autoit3.exe myscript.exe".

Regarding the error "variable must be of type "object" it is because you need to install a package (I dont remember which one by now ? maybe script support package ?) into your winpe image using peimg.exe tool.

More details here :

http://technet2.microsoft.com/WindowsVista...3.mspx?mfr=true

Thanks again for your help

Wow...I'd gone through the packages and dismissed them as irrelevant to my needs, but when you posted this, I decided it was worth a shot. ( I installed * - all the packages, just to be safe). Against all odds (by my judgement), it worked perfectly! Thanks for your input! I'm glad you got your script running too, in spite of MY input! :)

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

Wow...I'd gone through the packages and dismissed them as irrelevant to my needs, but when you posted this, I decided it was worth a shot. ( I installed * - all the packages, just to be safe). Against all odds (by my judgement), it worked perfectly! Thanks for your input! I'm glad you got your script running too, in spite of MY input! :)

no problem i had the same problem myself :)

Share this post


Link to post
Share on other sites

Wow...I'd gone through the packages and dismissed them as irrelevant to my needs, but when you posted this, I decided it was worth a shot. ( I installed * - all the packages, just to be safe). Against all odds (by my judgement), it worked perfectly! Thanks for your input! I'm glad you got your script running too, in spite of MY input! :)

no problem i had the same problem myself :)

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