Hi, I trying a prg routine to check the printer jobquene before I could send report to the printer. It works on some PCs but encounter OLE error 0x8004100 on few other PCs. All the PCs run on Win XP Pro. Not sure is there any files missing in those PCs. The code was downloaded and is written as follows:
lcComputer = "."
loWMIService = Getobject("winmgmts:" ;
+ "{impersonationLevel=impersonate}!\\" + lcComputer + "\root\cimv2")
colPrintQueues = loWMIService.ExecQuery ;
("Select * from Win32_PerfFormattedData_Spooler_PrintQueue Where " + ;
"Name <> '_Total'")
For Each loPrintQueue In colPrintQueues
?"Name: " + loPrintQueue.Name
?"Current jobs: " + transform(loPrintQueue.Jobs)
NEXT
Please advise. Thanks
James