Support Request: Issue on print jobs in error deletion



We have noticed Sitekiosk does not delete print jobs in error after a reset.

So we try to manipulate these jobs with SiteKiosk Model Object, without succes :(

function OnReset(){
	SiteKiosk.Logfile.Notification("RESET SK DETECTED >>> Clearing spooler ! ");

	//SiteKiosk.Logfile.Notification("DEFAULT PRINTER >>> " + SiteKiosk.Printer.DefaultPrinter);
	dPrinterName = SiteKiosk.Printer.DefaultPrinter;
	dPrinter = SiteKiosk.Printer.FindPrinter(dPrinterName);
	dJobCount = dPrinter.Jobs.Count;
	//SiteKiosk.Logfile.Notification("JOB COUNT >>> " + dJobCount);

	if(dJobCount > 0){
		for (i = 1; i <= dJobCount; i++) { 
			MyJob = dPrinter.Jobs.Item(i);
			res = MyJob.Delete();
			SiteKiosk.Logfile.Notification("Delete Job >>> " + MyJob.Info + " was delete >>> " + res);
		SiteKiosk.Logfile.Notification("No job to delete ! ");

We understand that this method could works because jobs are waiting (IsWaiting = true).

So we try to clearing spooler with MS-DOS command directly in SiteKiosk Model Object (for security reasons we could not launch à .bat) ; but it does not work to.
We have errors on path, probably an issue with the launched parameters.

function OnReset(){
	SiteKiosk.Logfile.Notification("RESET SK DETECTED >>> Clearing spooler ! ");
	SiteKiosk.ExternalApps.RunElevated("c:/windows/system32/cmd.exe net stop spooler");
	SiteKiosk.ExternalApps.RunElevated("c:/windows/system32/cmd.exe del c:\WINDOWS\System32\spool\PRINTERS\*.* /q /f");
	SiteKiosk.ExternalApps.RunElevated("c:/windows/system32/cmd.exe net start spooler");

Do you know a way to delete jobs in errors ?


Answer: (3)

Re: Issue on print jobs in error deletion 6/21/2022 2:21 PM

SiteKiosk has no further influence to the Windows print spooler and just passes the print job to the print spooler of the Windows system.

You can try creating a script to delete all spooled files in the print spooler on Windows:
-->Method D: Stop the print spooler and delete all spooled files
And call that script on a certain event.
(When using it “net.exe” must be allowed for the SiteKiosk user with using the System-Security-Manager “-->Customized-->Programs”.)

But note that this method should also not be able to delete print jobs which already were transferred to the printer (printer memory).

Please understand that our free support cannot offer any assistance with creating your own code or script files (apart from the detailed SiteKiosk and SiteKiosk Object Model documentation).

- General Information about customizing SiteKiosk:
- SiteKiosk Object model help for IE based skins:
- The SiteKiosk Object model help for Chrome Browser Skin can be requested via e-mail at support-europe(at)

Further hints and suggestions can be found in our developer blog at

If you need further assistance in creating individual coding solutions you can contact us via e-mail that we may find a solution against payment for your needs.

In case you are interested in a solution against payment please write a detailed description to suppoer-europe(at) that we can check the technical feasibility and the amount of work to make a quotation.
The adjustment fees are depending on the complexity of the changes and in general it costs 120 Euro per hour.

Michael Olbrich
Re: Issue on print jobs in error deletion 6/23/2022 11:44 AM

We find the good way to delete print jobs in error.

        //Initialization of the WScript Shell object
        var objShellExecDeletion = new ActiveXObject("Shell.Application");
        //stop spooler service to unlock spool folder (see below)
	objShellExecDeletion.ShellExecute("cmd.exe", "/k net stop spooler", "", "runas", 0);
        //delete all print job in queue
	objShellExecDeletion.ShellExecute("cmd.exe", "/k del c:\\Windows\\System32\\spool\\printers\\* /Q /F /S", "", "runas", 0);
        //start spooler
	objShellExecDeletion.ShellExecute("cmd.exe", "/k net start spooler", "", "runas", 0);

This code can be launch on the SiteKiosk.OnReset event.

Re: Issue on print jobs in error deletion 6/23/2022 12:32 PM
Thank you for your feedback.
My Account
Language (Tickets):