Support Anfrage: Issue on print jobs in error deletion

Beschreibung

Hello,

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);
		}
	}else{
		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 ?

Thanks

Antwort: (3)

Re: Issue on print jobs in error deletion 21.06.2022 14:21
Hello,

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:
http://support.microsoft.com/kb/946737/en-us
-->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).
https://www.sitekiosk.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?support.htm

Documentation:
- General Information about customizing SiteKiosk: https://www.sitekiosk.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?customization_%28site_skin%29.htm
- SiteKiosk Object model help for IE based skins: https://www.sitekiosk.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?index.htm
- The SiteKiosk Object model help for Chrome Browser Skin can be requested via e-mail at support-europe(at)provisio.com

Further hints and suggestions can be found in our developer blog at https://devblog.provisio.com/

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)provisio.com 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.

Regards,
Michael Olbrich
Re: Issue on print jobs in error deletion 23.06.2022 11:44
Hi,

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.


Regards,
Re: Issue on print jobs in error deletion 23.06.2022 12:32
Thank you for your feedback.
Mein Konto
Anmelden
Sprache (Tickets):