Link to home
Start Free TrialLog in
Avatar of jack niekerk
jack niekerkFlag for Netherlands

asked on

Finding out status of printspooler empty or not

Finding out status of printspooler empty or not
In Vb6 we do shelling this

I use ( advised by : Steve Knight )   this to turn a printer(s) off line
cscript "C:\Windows\System32\Printing_Admin_Scripts\nl-nl\prncnfg.vbs" -t  -p "HP OfficeJet One" +workoffline
cscript "C:\Windows\System32\Printing_Admin_Scripts\nl-nl\prncnfg.vbs" -t  -p "HP OfficeJet Two" +workoffline
this 5 total printers

Then start the job by setting the first printer on line
 cscript "C:\Windows\System32\Printing_Admin_Scripts\nl-nl\prncnfg.vbs" -t  -p "HP OfficeJet One" -workoffline
Start printwork for this one

Now before turning next printer on line I must know that spooler for this first Job is empy at printer
then next job , etc.
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jack niekerk

ASKER

Yes that works,
see while on hold this in >> redirected text

Task-id 224
Printer HP OfficeJet Pro 8710 (netwerk)
Document Testpage
Gegevenstype RAW
Status
Time 12/20/2019 15:04:37
Total pages 1
Total  jobs in inventory 1

and when done this


Total  jobs in inventory 0

So can do a loop with cscript prnjobs.vbs -l -p "Printer name"
untill i get this  output file and start next job

Thanks again !
Good, can look for other options too if needed - there, e.g. might be more efficient way with Powershell but frankly if I can get a simple bit of text like that easy enough to parse as you know - between batch, vbs, powershell if you can output something you can check it even in old VB.  Been good few years since I've written anything in VB6 but regularly have to parse info out of text files, XML etc. with VBScript, VBA, LotusScript due to having to solve 'not possible' issues.

Steve
this works fine for me,  the reason is i have a printer with 5 color trays, one output bin
have to  print orders with lines in it wich has to go by department to some color output
now they must sort by hand  1000+  papers by color!
Thus i can make flow all offline  run the program , everything is hold
When done , start first color   (can count wich are the most during job )
then if spooler empty next color.  
everything will be sorted then by color!

Regards Jack
Clever ideas, or you need a printer with multiple output bins :-)

Steve
Its a Kyocera , max they have is 2 output bins, so no option anyway