marynella has asked for the wisdom of the Perl Monks concerning the following question:

Hi!

I've a script which opens a IE but I get an error. Maybe sameone can help me.
A pice of code:

$obSh = Win32::OLE->new('WScript.Shell') or<br> die "Can't start Shell + error=", Win32::OLE::LastErro();<br> $path = "C:\\PROGRA~1\\INTERN~1\\IEXPLORE.EXE";<br> $obSh->run("$path $url", 1, true);<br> undef $obSh;

The error I get is: Can't start Shell error=Win32::OLE(0.17) error 0x80040154: "Class not registered

Note:I have Windows Script Host (WinXP/IE6.0). Someone tested the script on his computer and it works.

Thanks.

Replies are listed 'Best First'.
Re: Win32::OLE error
by TheFluffyOne (Beadle) on Nov 21, 2003 at 18:06 UTC

    Might be interesting to see whether you have the problem with VBS as well. Try the following two scripts to see if you get the same problem:

    ietest.vbs:
    set oShell = CreateObject("WScript.Shell") oShell.Run "iexplore.exe http://uk.yahoo.com", 1, TRUE
    ietest.pl:
    use Win32::OLE; $obSh = Win32::OLE->new('WScript.Shell') or die "Can't start Shell err +or=", Win32::OLE->LastError(); $obSh->run("iexplore.exe http://uk.yahoo.com", 1, 1) or die "Failed to + launch IE, error = ", Win32::OLE->LastError();

    Have to wonder why you are using WSH rather than just shelling out using backticks?

    Gordon

Re: Win32::OLE error
by VSarkiss (Monsignor) on Nov 21, 2003 at 17:36 UTC

    error 0x80040154
    Someone tested the script on his computer and it works.
    Sadly, both of these indicate that it's not a Perl problem. Rather, they point at "DLL Hell".

    Something recently installed on the computer where it fails has clobbered one or more DLLs and/or not updated the registry properly. You need to figure out the last time when it used to work, and what's been changed since then.