Pause all print jobs by default : How ?

U

user

Hello,
how to pause all print jobs by default ? registry parameters or scripting ?
Someone will resume each job after (..the one which are ok..)

thanks for helping me ...
 
G

Guest

You could pause printing on the printer you want (manually or by a script) ,
then resume printing after you have deleted jobs you don't want printed
 
U

user

Thanks for answering me..
This help me a lot but what about the moment when resume printing ?
Is there a way to also block the job queue when resume printing ? i would
like to deny people to print in the same time that the printer is ok to
print (resume time)...

It very simple but very hard to make it...
 
G

Guest

user said:
Thanks for answering me..
This help me a lot but what about the moment when resume printing ?
Is there a way to also block the job queue when resume printing ? i would
like to deny people to print in the same time that the printer is ok to
print (resume time)...

It very simple but very hard to make it...


You're right

You could try using WMI event notifications to pause print jobs as they come
to the printer. That would be something like this:

strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")

Set colJobs = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceCreationEvent WITHIN 3 " _
& "WHERE Targetinstance ISA 'Win32_PrintJob'")

Do
set objJob = colJobs.NextEvent.TargetInstance
objJob.Pause
Loop


Hope this is of some help.
 
U

user

Hello,

Thanks for your answer.. i will test it soon ..
It seems to be the thinks i was looking to...

One last Question : This kind of "Do ... Loop" does not overload the
processor activity ????

Thanks again ...
 
G

Guest

If you don't pass it a timeout interval, NextEvent method waits for the next
event indefinitely,which pauses the loop so it executes only once for each
event.

Put a test message into the loop and see what happens:



Do
set objJob = colJobs.NextEvent.TargetInstance
objJob.Pause
WScript.Echo objJob.Document & " paused"
Loop
 
U

user

Hello !
That's works VERY fine ..so THANK YOU ...
Sometimes, the print job seems to go before the script ..so it prints and
it's written :" Paused - print in progress" in the printer information... a
little fun...
Could i change the WITHIN Values from 3 to 1 (0 possible ?) to be more
efficient ?
For example : the printer test page is always being printed .....
With IE 7, a web page is print with a 3 WITHIN value.... but not with a 1
value ...

Thanks again...
I will put this script on every computer of my office and ask for
credentials to resume the job print..so in a access database i will allow
limited print .... isn't it a good idea ????


Thanks again and again ..
 
U

user

Hello,
When i test this script on a server with a share printer, it doesn't work.
the job is paused but it is being resume itself immediatly ....
Is there a parameter to allow the pause on a windows 2003 server ???

thanks again !
 
G

Guest

It is possible that some jobs still get printed, because WITHIN 3 means it
checks for new print jobs every 3 seconds. You can use WITHIN 1 instead of
WITHIN 3, but not WITHIN 0. You can even try to use WITHIN 0.5, but that
would mean the it checks for new print jobs two times each second, and I'm
not sure that's a good idea.
I'm not sure why it is not working on your server, I tested the script on
XP, and the printer was not shared.
 
U

user

On Vista, it works fine (with a local usb printer) .. but on a 2003 server,
the print job sitll get printed..... this is not fair !!! :)

Thanks
 
U

user

Hello back !
The same thing happen, with network printer, the job print resume itself and
go printing...
this is perhaps a bug .. so it's ugly for me....

Thanks again !

Alan Morris said:
Make sure you setup the queue to only start printing after the last page
has spooled
on printer properties Advanced tab.

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no
rights.

user said:
On Vista, it works fine (with a local usb printer) .. but on a 2003
server, the print job sitll get printed..... this is not fair !!! :)

Thanks
 
U

user

When i pause the printer, the job is well paused and stay in this state
even i resume the printer....
So I think the printing job go to quickly when it's a network printer... the
script does not have the time to pause the job..
Is there a way to delay the print job in the spool so that the script could
pause the job ?


Thanks again !!

Alan Morris said:
Make sure you setup the queue to only start printing after the last page
has spooled
on printer properties Advanced tab.

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no
rights.

user said:
On Vista, it works fine (with a local usb printer) .. but on a 2003
server, the print job sitll get printed..... this is not fair !!! :)

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top