Yigalr01 Posted September 21, 2010 Posted September 21, 2010 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 ?
water Posted September 21, 2010 Posted September 21, 2010 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Yigalr01 Posted September 21, 2010 Author Posted September 21, 2010 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 !!!
water Posted September 21, 2010 Posted September 21, 2010 (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 September 21, 2010 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now