[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-admin
Subject:    RE: Manipulating NT shared printers via Perl
From:       "Bill Odom" <wnodom () intrasection ! com>
Date:       2000-07-25 8:39:12
[Download RAW message or body]

Egil:

I've got a module that I've been tinkering with for a while that may do what
you need.  Essentially, it's a pass-through to the Windows print spooler
API. It's kind of raw, but I've used it to add, delete, and enumerate
printers and printer drivers for both 95 and NT via logon scripts.  I was
going to wait to release it until the functionality was a little more
consistent across both platforms, but it sounds like you could get some use
out of it now.

Anyway, you can find it at http://www.tmtowtdi.com/.  My apologies for the
rather lean site -- I wasn't planning on going live quite this soon.  :)

The module requires Win32::API, which you can get from Aldo Calpini's site,
http://dada.perl.it/.  I believe you can also install it via PPM.

James:  I haven't used the DLL you mentioned, but it sounds handy.  Does it
require client-side registration with regsvr32 before it can be used?

--Bill Odom


-----Original Message-----
From: perl-win32-admin-admin@listserv.ActiveState.com
[mailto:perl-win32-admin-admin@listserv.ActiveState.com]On Behalf Of
Krummel, James C - PGGC-6
Sent: Thursday, July 20, 2000 4:32 PM
To: 'perl-win32-admin@listserv.activestate.com'
Cc: '91315555@mobilpost.com'
Subject: RE: Manipulating NT shared printers via Perl



Egil,

There is a handy DLL you can download from Clarence Washington excellent
scripting site.  It comes complete with the full source code, and some VBS
samples.  Lots of other great stuff there too.

Hope It Works For You,

James

http://cwashington.netreach.net/downloads/developers/wshadmin_source.zip

use WIN32::OLE qw(in);

$Wprint = Win32::OLE->CreateObject('wshadmin.Printers');

if ($Wprint->DeletePrinter("\\server\HPDeskjet")) { print "Error!\n" } else
{ print "Deleted!\n" };
if ($Wprint->AddPrinter("\\server\Laserjet")) { print "Error!\n" } else {
print "Added!\n" };

@Queues = split(",", $Wprint->EnumPrinters() );

foreach $Queue (@Queues ){
	print "$Queue\n";
}

>From: Egil Helland <91315555@mobilpost.com>
>Reply-to: Egil Helland <91315555@mobilpost.com>
>To: perl-win32-admin@listserv.activestate.com
>Subject: Manipulating NT shared printers via Perl
>Date: Wed, 19 Jul 2000 15:07:26 +0100
>
>Hi there,
>
>I am sitting here trying to find some good methods of distributing printer
administration for a given number of printers >to a given set of users.
>
>Then I started to wonder if any of you guys have been trying to do anything
like this or know of any modules around that >can help me out.
>
>All help appreciated.
>
>Cheers,
>
>Egil

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic