Re: Win32::Printer::Enum::Printer($server)
- From: iansullivan@xxxxxxxxxxxxxxxxxxxxxxxxxxx (Sully)
- Date: Tue, 12 Jul 2005 12:12:23 +0000 (UTC)
> Thomas Kratzwrote:
>
> I tend to use WMI these days. You might want to try this:
> .
> .
> .
> .
>
Thomas,
I am trying to adjust your code, which I think will solve my problem
(Thanks, I was going crazy!) but I am a little lost as to how I might
adjust it to email me if one of the queues error.
the $attrib returns the column heading rather than the data from the
array.
I'm sure I am missing something simple but my brain has overheated. .
..
Here is what I have so far:
#use strict;
use warnings;
use Win32::OLE qw/in/;
Win32::OLE->Option(Warn => 1);
$ARGV[0] ||= '';
my $wmi =
Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate,(security)}$ARGV[0]")
or die "error initializing WMI interface, ",
Win32::OLE->LastError;
my @attrib = qw/DeviceID Status/;
print join(', ', @attrib), "\n";
for my $p ( in($wmi->InstancesOf('Win32_Printer')) ) {
$_ ||= '' for @$p{@attrib};
print join(', ', @$p{@attrib}), "\n";
if($attrib[1] ne Error)
{
# system("D:/\\server/share/\\dir/\\frmsendmail.exe blank\.txt -t
me\@mine.com -priority 1 -subject a_printer_has _a_problem");
}
}
.
- Follow-Ups:
- Re: Win32::Printer::Enum::Printer($server)
- From: Thomas Kratz
- Re: Win32::Printer::Enum::Printer($server)
- From: Thomas Kratz
- Re: Win32::Printer::Enum::Printer($server)
- Prev by Date: Re: mod_perl2 passing env vars when doing internal_redirects
- Next by Date: re:Win32::Printer::Enum::Printer($server)
- Previous by thread: LWP problems
- Next by thread: Re: Win32::Printer::Enum::Printer($server)
- Index(es):
Relevant Pages
|
|