littleclown Posted December 9, 2006 Author Posted December 9, 2006 10x for your support. Maybe I have a problem to run vbs files, because nothing happen... again. Maybe have a problem to put printer real name. This is the printer path: \\server\printer I try to put the name, and the full path, but nothing. I will think to clean jobs in other way, coz this don't work. The crazy think is that the script who cleans all printers works! But when I try to tell him one printer - nothing. 10x again for your help. If anybody know other way to clean printer jobs, please post it here.
JSThePatriot Posted December 9, 2006 Posted December 9, 2006 10x for your support. Maybe I have a problem to run vbs files, because nothing happen... again. Maybe have a problem to put printer real name. This is the printer path:\\server\printerI try to put the name, and the full path, but nothing.I will think to clean jobs in other way, coz this don't work. The crazy think is that the script who cleans all printers works! But when I try to tell him one printer - nothing.10x again for your help.If anybody know other way to clean printer jobs, please post it here.@littleclownThe means by which you are trying to clean out the print jobs is correct. Check the CompInfo library in my signature. It uses _ComputerGetPrinters(). You can use the example to get the exact name of the printer. (It may be different than you think)I haven't added the Methods/Functions (CancelAllJobs()) to my functions yet, but I think I can help you. I need to ask a few questions.Are the printer drivers installed locally? (If that is the case you shouldn't have to access the server directly through $strComputer)You may consider having the script list through the printer names, and allowing you to select one to CancelAllJobs on. That way you are sure there are no typo's in your printer name.Try my library example of _ComputerGetPrinters(), and let me know if it properly returns the name for you.I hope I can help,JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
littleclown Posted December 9, 2006 Author Posted December 9, 2006 01. I use _GetAllPrinters() from somewhere and works in other case. The printer name is this, but I don't know can I use just the name or full path (i tried both). 02. I think the drivers are installed on the server. But my printer is popular and have drivers in my PC too I think (but the print server use the drivers) I don't know what typo's mean. My printer name is like XXX00XXX00XXX_0 alphabetical and numbers chars only (and "_" char).
JSThePatriot Posted December 9, 2006 Posted December 9, 2006 01. I use _GetAllPrinters() from somewhere and works in other case. The printer name is this, but I don't know can I use just the name or full path (i tried both).02. I think the drivers are installed on the server. But my printer is popular and have drivers in my PC too I think (but the print server use the drivers)I don't know what typo's mean. My printer name is like XXX00XXX00XXX_0 alphabetical and numbers chars only (and "_" char).Do all the printers have jobs on them, or just one in particular? What you could do instead of worrying about clearing say just that one is set it to clear all the printers before you get there in the morning. Say at 2 - 5 am.Also another way you can go about this other than the name is through PrinterStatus.Also _ComputerGetPrintJobs() can give you the name of a particular printer that has jobs.I hope this helps some.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
littleclown Posted December 9, 2006 Author Posted December 9, 2006 Some have jobs, some haven't. This printer is the only one who must be cleaned every morning (but needs some actions before that, and thats why i must start this clean manually (i will put this in bigger script))
JSThePatriot Posted December 9, 2006 Posted December 9, 2006 Some have jobs, some haven't. This printer is the only one who must be cleaned every morning (but needs some actions before that, and thats why i must start this clean manually (i will put this in bigger script))Can you run my _ComputerGetPrinters(), and show me the output from it? You can use the Examples file, and change it from a message box to something that writes to a text file.Thanks,JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
littleclown Posted December 10, 2006 Author Posted December 10, 2006 I attached the shot of msgbox (i am so lazy ).
JSThePatriot Posted December 10, 2006 Posted December 10, 2006 I attached the shot of msgbox (i am so lazy ).Okay lets see if we can get this working for you. Local $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20 Local $colItems, $objWMIService, $objItem $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Printer WHERE Name = '\\Sof11srv002\SOF11PRT12ALC_1'", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems $objItem.CancelAllJobs() Next Else MsgBox(0, "ERROR!", "The object was not created.") EndIf Try that. Let me know how it works for you. Thanks, JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
littleclown Posted December 10, 2006 Author Posted December 10, 2006 $cI_Compname = "localhost" - nothing $cI_Compname = "Sof11srv002" - error: "Script.au3 (6) : ==> Variable must be of type "Object".:" 10x for this try.
JSThePatriot Posted December 10, 2006 Posted December 10, 2006 $cI_Compname = "localhost" - nothing$cI_Compname = "Sof11srv002" - error: "Script.au3 (6) : ==> Variable must be of type "Object".:"10x for this try. Try my _ComputerGetPrintJobs(), and tell me what that returns if anything. (When that printer has a job)JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
littleclown Posted December 11, 2006 Author Posted December 11, 2006 This is one job from this printer. This jobs are done, but the queue "remember" them. I wont to clean done and no done jobs. (Cool English )untitled.bmp
JSThePatriot Posted December 11, 2006 Posted December 11, 2006 (edited) This is one job from this printer. This jobs are done, but the queue "remember" them. I wont to clean done and no done jobs. (Cool English ) Now when you say jobs are "queued" that means that isn't print in progress, the question being; is that the local queue or the queue on the server? What was the $cI_CompName that you used? localhost? (default) Have you tried the following? (Below assumes you used "localhost" on the above picture) Local $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20 Local $colItems, $objWMIService, $objItem $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Printer WHERE Name = 'HP LaserJet 2420 PCL 5e'", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems $objItem.CancelAllJobs() Next Else MsgBox(0, "ERROR!", "The object was not created.") EndIf Edit: Punctuation Keep trying, JS Edited December 11, 2006 by JSThePatriot AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
littleclown Posted December 12, 2006 Author Posted December 12, 2006 First I use localhost, but the queue file is on the server. I use servername. I use everything . The queue is viewvable for everybody in this network.
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