Home: Perl Programming Help: Win32 Programming Help:
Perl: Win32 OLE problem - Access denied.

New User

May 28, 2010, 12:05 AM

Views: 9635
Perl: Win32 OLE problem - Access denied.


I have written a perl script using Win32 OLE module and it is failing while connecting to server due to "Access denied" error (Using Windows Vista).

Below was my script test.pl:


use Win32::OLE qw(in with);

my $testHost = "localhost";

$WMI = Win32::OLE->new('WbemScripting.SWbemLocator') || /* This call got succeeded */
die "Cannot access WMI on local machine: ", Win32::OLE->LastError;

$Services = $WMI->ConnectServer($testHost) ||
die "Cannot access WMI on remote machine: ", Win32::OLE->LastError; /* error comes at this line */
print "SERVICE : $Services\n";


The problem occurs while connecting to the localhost.

Can anyone tell me why this problem occurs?

What are the possibility this kind of problem may happen in Windows platform (Windows Vista)?

Thanks in advance,