>-- Original Message --
>Date: Mon, 02 Jan 2006 20:58:46 -0800
>From: "$Bill Luebkert" <[EMAIL PROTECTED]>
>To: Craig A Dayton <[EMAIL PROTECTED]>
>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 ?
>
>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();

No problem for B815 on W2000-Pro having Win32::OLE version 0.1403.



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

Reply via email to