I'm trying to make a powershell script that will make it easy for a machine operator to clear prints from a customized Zebra printer.
Context: This printer does not operate like a regular Zebra printer, it will only print after getting a print signal from the equipment the operator is working on. For regular labeling this is not a problem.
The problem I am trying to solve occurs on printing jobs where each label is unique, and you have hundreds of prints in a job. This will cause the print job to be sitting partially in the Win print queue waiting to be sent to the printer.
And if you have to interrupt this job, you have to manually clear the queue, and then clear the remaining prints off the Zebra printer.
I am trying to make this as easy and quick as possible for the operator.
PS C:\Users\Ballsprett> Get-PrintJob -PrinterName Zebra1 Id ComputerName PrinterName DocumentName SubmittedTime JobStatus -- ------------ ----------- ------------ ------------- --------- 10 Zebra1 Thelabel.lbl 12/15/2020 3:42:4... Error, Print...
I'd like to create a clickable script that just by doubleclicking it will get me the Id on this printer, so I can remove/cler the print job.
Remove-PrintJob -PrinterName Zebra1 -ID 10
I'd like the script to find the ID on this printer, and either put it into a variable or remove the job directly. I've gotten this far, but if I try a variable, it will put it like this:
PS C:\Users\Ballsprett> Get-Variable PriID Name Value ---- ----- PriID MSFT_PrintJob (Id = 7, PrinterName = "Zebra1")
I can't figure out how to use this.
--
Then, after the job is removed, I'd like to send the command ~JA to clear the prints off the printer. It is only those three characters, but I may need to add CR to it, haven't gotten that far yet.
I know this will include using
Out-Printer -Name "Zebra1"
I do not know how to send just characters/text stream to the printer. All info and examples I see is for sending files, not just pure ASCII text.
Any help would be appreciated.
$x = Get-PrintJob -PrinterName Zebra1then call$x.iddoes that work?