Script to flush print queue

Author
Discussion

shed driver

Original Poster:

2,327 posts

166 months

Tuesday 7th March 2023
quotequote all
I'm using an engraving machine to make coffin and casket plates at work. The workshop computer is running Win 10 Pro and not connected to the Internet, it is just to run the engraving software and drive the engraver. (Vectric Cut2d, and a Roland EGX-20)

Occasionally the software will output two jobs to the engraver, meaning that when we come to the next job we end up wasting a plate as it has all the previous details.

I can clear the print queue manually via the printer dialogue and also from the command line. Is there a way to have a short cut on the desk top to clear the queue with just a double click?

SD.

21TonyK

11,805 posts

215 months

Tuesday 7th March 2023
quotequote all
Showing my age.

Can you not put the command line(s) in a batch file then a shortcut to it?

somouk

1,425 posts

204 months

Tuesday 7th March 2023
quotequote all
Batch file or powershell script would do it. Use chatgpt to write it for you.

crmcatee

5,730 posts

233 months

Tuesday 7th March 2023
quotequote all
Right click on desktop,

New, Shortcut.

Paste what you normally put into the command line in the box.

Next,

Give it a name.

arcturus

1,492 posts

269 months

Tuesday 7th March 2023
quotequote all
Open Notepad.

Enter this text:

net stop spooler
del %systemroot%\System32\spool\printers\* /Q
net start spooler

Save the file to your desktop with a .bat extension rather than a .txt extension - so something like clearqueue.bat

When running the .bat file, right click it and select 'Run as administrator'


Trevatanus

11,197 posts

156 months

Tuesday 7th March 2023
quotequote all
Have you tried turning it off and on again?