Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
; Delete Print Jobs ; Stop the Spooler Service AddExtender("wwwnt34i.dll") ;aService = "Spooler" ;Win XP aService = "Print Spooler" ;Win 7 state = wntSvcStatus("", aService, 0, 2) ; Get the current state of the service If state==4 ; Service is running wntSvcControl("", aService, 0, 1) ; Stop the Service ; Wait for service to stop While state != 1 TimeDelay(1) state = wntSvcStatus("", aService, 0, 2) ; get the current state of the service EndWhile EndIf ; Delete files in Spool oldvalue = IntControl( 92, "disable", 0, 0, 0 ); Disable File Redirection FileDelete( DirWindows(0):'\system32\spool\printers\*.shd' ) FileDelete( DirWindows(0):'\system32\spool\printers\*.spl' ) IntControl( 92, "revert", oldvalue, 0, 0 ) ; Enable File Redirection ; Restart the Spooler Service wntSvcStart("", aService, 0, "", "") ; start the Spooler service ExitIf running on XP or newer, you may be able to accomplish this using WMI. Check out the CancelAllJobs method in the Win32_Printer Class.
Or you might be able to use the following command line.
First, Run queue view:
Run("rundll32","printui.dll,PrintUIEntry /o /n\\machine\printer")Then send the keystrokes to 'cancel all'.
Article ID: W16661
File Created: 2013:06:26:11:03:32
Last Updated: 2013:06:26:11:03:32