![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Cancel a print job from the shell Hello all, I am stuck. I want to be able to use PS to cancel a specific printjob. I know the printer name and the JobID. How can I pull this off? Is there a powershell way to say " Cancel JobID 123 on Server1" ?? Any suggestions would be greatly appreciated. Thanks, Norm |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Cancel a print job from the shell NormyB wrote: > Hello all, > > I am stuck. I want to be able to use PS to cancel a specific printjob. > I know the printer name and the JobID. How can I pull this off? Is > there a powershell way to say " Cancel JobID 123 on Server1" ?? > > > Any suggestions would be greatly appreciated. > > Thanks, > > Norm > I checked WMI and also a DLL from the resource kit, and they can only purge *all* jobs from what I can tell. You can however use plain old 'net print' from PowerShell though: http://www.windowsitpro.com/Articles...533/14533.html Marco |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Cancel a print job from the shell Try PrintSystemJobInfo Class' Cancel Method. You may need to load its assembly, System.Printing (system.printing.dll) http://msdn2.microsoft.com/en-us/lib...emjobinfo.aspx http://msdn2.microsoft.com/en-us/lib...o_methods.aspx -- Kiron |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Cancel a print job from the shell On Jul 19, 8:14 pm, "Kiron" <Ki...@HighPlainsDrifter.com> wrote: > Try PrintSystemJobInfo Class' Cancel Method. > You may need to load its assembly, System.Printing (system.printing.dll) > > http://msdn2.microsoft.com/en-us/lib...g.printsystemj... > > -- > Kiron Thanks Marco I did find Wni32_PrintJob which has a method CancelAllJobs() but I'm not sure how to use it, or more accuratly stated, I dont know how to use it to tell a specfic printer on a print share to cancell all jobs. Thanks again, Norm |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Cancel a print job from the shell Try this: Get-WmiObject Win32_Printer -computerName HAL9000 | Where {$_.Name -eq "Microsoft XPS Document Writer"} | ForEach { $_.CancelAllJobs() } -- greetings dreeschkind "NormyB" wrote: > On Jul 19, 8:14 pm, "Kiron" <Ki...@HighPlainsDrifter.com> wrote: > > Try PrintSystemJobInfo Class' Cancel Method. > > You may need to load its assembly, System.Printing (system.printing.dll) > > > > http://msdn2.microsoft.com/en-us/lib...g.printsystemj... > > > > -- > > Kiron > > Thanks Marco > > I did find Wni32_PrintJob which has a method CancelAllJobs() but I'm > not sure how to use it, or more accuratly stated, I dont know how to > use it to tell a specfic printer on a print share to cancell all > jobs. > > > Thanks again, > > Norm > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can parent shell monitor run/crash status of Child shell/exe ? | PowerShell | |||
| Can't cancel print job | Vista General | |||
| Can't cancel color print | Vista print fax & scan | |||
| Executing Power Shell Scripts from Windows Shell | PowerShell | |||