Jump to content

IECreate on a server without a desktop fails


Recommended Posts

Hey, 

I have a script, thats starting a browser, navigate to a page, scrapping some datas and store them. If I connect to the server with Remote Desktop and execute the script with powershell, everything works fine. 

Then I installed an IIS, wrote a small php script, that get a variable and execute the script with the variable via "exec(path...)". 

But that doenst work, I always get the error
 

--> IE.au3 T3.0-2 Error from function _IECreate, (Browser Object Creation Failed) 
--> IE.au3 T3.0-2 Error from function _IEFrameGetCollection, $_IESTATUS_InvalidDataType 
--> IE.au3 T3.0-2 Error from function _IEFormGetCollection, $_IESTATUS_InvalidDataType 
--> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidDataType 
--> IE.au3 T3.0-2 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType 
--> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidDataType 
--> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType 
--> IE.au3 T3.0-2 Error from function _IEBodyReadHTML, $_IESTATUS_InvalidDataType 
--> IE.au3 T3.0-2 Error from function _IEQuit, $_IESTATUS_InvalidDataType

So, the script cant create a Browser Object and fails. I assume its bc the IIS runs with an own user that doesnt have a desktop and cant create a browser object.

Anyone has an idea how to solve it?

My first attempt was to tell php that it should execute the script with the user that has an active RDP Session with a desktop. But doenst work.

Any other ideas?

Link to comment
Share on other sites

  • Moderators
3 hours ago, Introser said:

Anyone has an idea how to solve it?

How can we offer suggestions when you give us no code to look at??

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

8 hours ago, JLogan3o13 said:

How can we offer suggestions when you give us no code to look at??

Its not rlly a code Problem. The Code works on the server and on my desktop pc if I start them manually. If I start the code from php it doenst work. Its more like a general problem. iMacro for example has a handler or some stuff like that for exactly that situation. But I cant find any similar for autoIT

 

But here is the "code" that work on the server but not when startet from the IIS: 

 

#include <IE.au3>

Local $oIE = _IECreate("example.com", 0, 0, 1)
$frame = _IEFrameGetCollection ($oIE, 0)
Local $oForm = _IEFormGetCollection($frame, 0)
...

It breaks at the first line and the errors are in the post about

Link to comment
Share on other sites

25 minutes ago, Danp2 said:

Please explain why the script needs to be launched like this instead of something like task manager.

The script scraps some data from a website. I prefer to access the data with an http call from another server. Like http://123.123.123?myvariable=123
On the server with autoIt, there is the IIS server, that get the call. The IIS server then should start the autoIT script, get back some datas an print them on the website.

 

I could do it with a socket server on autoIT that listen to calls but I prefer http. There are some http autoIT scripts but I prefer IIS :D

 

But I found a solution. I changed the user from the IIS server to a normal User and it works 

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