Sign in to follow this  
Followers 0
confutatis

My continuing brain freeze...

31 posts in this topic

#1 ·  Posted (edited)

Hello again...

Here's a simple script:

$obj=ObjCreate("Shell.Application")
$obj.Open ("C:\Program Files\")

When I run the script, I get this error:

$obj.Open("c:\program files\")

$obj^ERROR

Error: Variable must be of type "Object".

I have no clue why it's telling me this. I'm running XP and the AutoIt beta. Please put a heat gun to my brain by telling me what I've done wrong.

Thanks,

David

--As a matter of fact, I went to the AutoIt3 help documents under ObjCreate and tried running the example file and received the same error.

Edited by confutatis

Share this post


Link to post
Share on other sites



Hello again...

Here's a simple script:

$obj=ObjCreate("Shell.Application")
$obj.Open ("C:\Program Files\")

When I run the script, I get this error:

$obj.Open("c:\program files\")

$obj^ERROR

Error: Variable must be of type "Object".

I have no clue why it's telling me this. I'm running XP and the AutoIt beta. Please put a heat gun to my brain by telling me what I've done wrong.

Thanks,

David

--As a matter of fact, I went to the AutoIt3 help documents under ObjCreate and tried running the example file and received the same error.

Works for me, are you sure you are using Beta version to run it.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Works for me, are you sure you are using Beta version to run it.

Yeah, I'm using the beta version...Very odd.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Yeah, I'm using the beta version...Very odd.

Put the following code at the top of script your just to check

$ver=@AutoItVersion
MsgBox(0, "AutoIT Version", $ver)
Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Put the following code at the top of script your just to check

$ver=@AutoItVersion
MsgBox(0, "AutoIT Version", $ver)
Comes back 3.1.1.75

Share this post


Link to post
Share on other sites

Comes back 3.1.1.75

Download the latest Beta which is 3.1.1.83


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Download the latest Beta which is 3.1.1.83

Upgraded....still no go...Very frustrating.

Share this post


Link to post
Share on other sites

Upgraded....still no go...Very frustrating.

Did you type the code in your post or "copy and Paste". The reason for asking is incase there is a typing error in the original script.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Seems like I create any object but the Shell.Application object...UGH!

Share this post


Link to post
Share on other sites

Seems like I create any object but the Shell.Application object...UGH!

Sorry I have run out of ideas


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

$obj=ObjCreate("Shell.Application")

MsgBox(0, '', @error)

$obj.Open ("C:\Program Files\")

Comes back with -2147024770 for the error code, and then the same error.

Could this have anything to do with XP SP2 and security?

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Sounds like some controls got unregistered, or you have corruption in the registry.

It might help to reinstall WSH...

http://www.microsoft.com/downloads/details...&displaylang=en

Edited by Skruge

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

How about reregistering Shell32.dll?

Regsvr32 Shell32.dll


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

Nope...but thanks for all the suggestion.

Share this post


Link to post
Share on other sites

How about reregistering Shell32.dll?

Regsvr32 Shell32.dll

No, still no object...I tried the same script on an NT machine and got the same error.

Share this post


Link to post
Share on other sites

Just bringing this back up front...wondering if anyone else has any ideas.

I've been searching the Web for a solution and I have found some articles related to the shell.application object and XP SP2 security. Has anyone else read about this? Most of the articles mention something about Active Desktop needing to be enabled (but not necessarily running) in order for a programmer to use the shell.application object. Also, there's mention that NT must also have Active Desktop enabled to be able to use this object.

Any thoughts, comments, solutions?

David

Share this post


Link to post
Share on other sites

i run standard XP home SP 2 and never had any problems regarding shell.application.

Thanks for the post...I just connected to my XP home computer and ran the shell.application script--and it worked. Apparently, this has something to do with XP Pro security.

David

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