Thanks, Bill.

See comments below. 

> -----Original Message-----
> From: $Bill Luebkert [mailto:[EMAIL PROTECTED] 
> Sent: 01/02/2006 20:59
> To: Craig A Dayton
> Cc: Perl-Win32-Admin@listserv.ActiveState.com
> Subject: Re: Win32::OLE and WMI Invalid Syntax
> 
> Craig A Dayton wrote:
> 
> > Might there be an existing bug in Win32::OLE when 
> attempting to create 
> > an WMI Service object?  I'm running perl build 815 [211909] 
> on WinXP 
> > Pro w/SP2 and the latest patches.
> > 
> > The script will always fail on the first line regardless of the 
> > moniker specified. Its running with administrator privileges.
> > 
> > my $WMIServices = Win32::OLE->GetObject("WinMgmts:") || die; my 
> > $DriveCollection = $WMIServices->InstancesOf( "Win32_DiskDrive" );
> 
> This gets no error for me (B811):
> 
> use Win32::OLE;
> my $WMIServices = Win32::OLE->GetObject("WinMgmts:") || die;
> 
> > The error message returned is: 
> > 
> > Win32::OLE(0.1703) error 0x800401e4: "Invalid syntax"
> > after character 0 in "WinMgmts:" at C:\Projects\WMI\WDiskDrives.pl 
> > line 99
> > 
> > Searching the email archives, I see a number of people experienced 
> > this problem a few years back, but I didn't see any 
> resolutions posted.
> > 
> > I'm able to access WMI using other tools such as WMI Object Brower, 
> > CIM Studio, and wmic on the Win XP machine.  So, I think WMI is 
> > configured correctly.
> > 
> > Has anyone else solved this problem?
> 
> What build are you on ?

Its Win32::OLE is version 0.1703.

Tried the statements below and the same error message is generated.
Something weird is going on. :(

-Craig

> 
> Try just these 2 lines in a script and see if it changes :
> 
> use Win32::OLE;
> my $WMI = Win32::OLE->GetObject("WinMgmts://./root/cimv2") or
>   die "GetObject: " . Win32::OLE->LastError();
> 

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to