Sign in to follow this  
Followers 0
Yigalr01

Printers management

4 posts in this topic

Hello !!!

I am looking for solution to manage printers from autoit script

I need solution for 2 things :

* pause job

* resume job

In specified printer or printer from the list of available printers.

Can you help me please ?

;)

Share this post


Link to post
Share on other sites



Here is a good UDF that let's you create a list of printers and/or print jobs.

Here you find a thread about deleting print jobs. Something similar might do the start/stop of a print job (needs some googleing).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thank You for respond !

But I am looking for pausing job....

I don't need to delete the jobs....

I want to allow to user . print documents to paused printer.

And at the end of a working day to print all jobs together !!!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thank You for respond !

But I am looking for pausing job....

I don't need to delete the jobs....

I want to allow to user . print documents to paused printer.

And at the end of a working day to print all jobs together !!!

Then use the WMI Win32_Printer class and the Pause and Resume method. M$ describes it in detail.

; Generated by AutoIt Scriptomatic

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$strPrinter = "\\servername\printername"    ; ===> Change to your spoolserver / printer name <===

$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Printer WHERE Name='" & $strPrinter & "'", "WQL", _
    $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
 For $objItem In $colItems
    $intResult = $objItem.Pause ; Pause Printer     
    $intResult = $objItem.Resume ; Resume Printer
 Next
Else
 Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Printer" )
Endif
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0