Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
W2K - SP2 WB2004A
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_printjob.asp?frame=true
For help writting the WMI code see the WMI scripter utility:
If licensed with 2004C:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/WMI/WMI_Scripter/2004B~and~Newer+!!~WMI_Scripter~!!.txt
If older version:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/WMI/WMI_Scripter/2004A~and~Older+!!~WMI_Scripter-Older~!!.txt
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; How to execute the Pause method from the ; Win32_PrintJob class ; ; The Pause WMI class method suspends a print job. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Locator = ObjectOpen("WbemScripting.SWbemLocator") Service = Locator.ConnectServer() Security = Service.Security_ Security.ImpersonationLevel = 3 Class = "Win32_PrintJob" Instance = Service.InstancesOf(Class) hEnum = ObjectCollectionOpen(Instance) While 1 Obj = ObjectCollectionNext(hEnum) If Obj == 0 Then Break ;Execute the Pause() method on object Obj.Pause() EndWhile ObjectCollectionClose(hEnum) ObjectClose(Instance) ObjectClose(Security) ObjectClose(Service) ObjectClose(Locator) Exit
Is there no (more easy) way to halt the printer before the job comes in ?
printer = "\\VS-HV111\D-HV025" ;pause printer RunShell("rundll32","printui.dll,PrintUIEntry /Xs /n %printer% status pause","",@HIDDEN,@NOWAIT) ;delete all printjobs RunShell("rundll32","printui.dll,PrintUIEntry /Xs /n %printer% status purge","",@HIDDEN,@NOWAIT) ;release printer RunShell("rundll32","printui.dll,PrintUIEntry /Xs /n %printer% status resume","",@HIDDEN,@NOWAIT) Exit
Article ID: W16663
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38