Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Win32::OLE qw(in with); use Win32::Registry; use Win32::OLE('in'); use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20; my $WMI = Win32::OLE->new('WbemScripting.SWbemLocator') || die "Cannot access WMI on local machine: ", Win32::OLE->LastError; $host = "COMPUTER"; my $Services = $WMI->ConnectServer($host) || die "Cannot access WMI on remote machine: ", Win32::OLE->LastError; my $sys_set = $Services->InstancesOf("Win32_Printer"); foreach my $sys (in($sys_set)) { my $share = $sys->{Shared}; if ($share eq 1) { print $sys->{ShareName}; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mapped Printer
by BrowserUk (Patriarch) on Aug 11, 2011 at 13:11 UTC | |
by Anonymous Monk on Aug 11, 2011 at 13:17 UTC | |
by BrowserUk (Patriarch) on Aug 11, 2011 at 13:47 UTC |