mrcactu5 has asked for the wisdom of the Perl Monks concerning the following question:
When we run it remotely through Firefox it gives: Can't call method "InstancesOf" on an undefined value at (file name) line 5. I have spent all morning and much of the afternoon reading about OLE (Object Linking and Embedding), the COM (Component Object Model), WMI (Windows Management Instrumenation) and remote scripting in general for Windows 2000.use Win32::OLE 'in'; my $strComputer = "192.168.0.10"; my $objWMI = Win32::OLE->GetObject("winmgmts:\\\\$strComputer\\root\\c +imv2"); # or die "Failed to create object"; my $objDisks = $objWMI->InstancesOf("Win32_LogicalDisk"); for my $objDisk (in $objDisks){ print "DeviceID: ", $objDisk-DeviceID, "\n"; print "FileSystem: ", $objDisk->FileSystem ,"\n"; print "FreeSpace: ", $objDisk->FreeSpace,"\n"; print "Name: ", $objDisk->Name,"\n"; print "Size: ", $objDisk->Size,"\n"; print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE thru CGI
by Bloodnok (Vicar) on Jan 08, 2009 at 19:54 UTC | |
|
Re: Win32::OLE thru CGI
by frieduck (Hermit) on Jan 08, 2009 at 19:55 UTC | |
|
Re: Win32::OLE thru CGI
by NetWallah (Canon) on Jan 08, 2009 at 19:59 UTC |