Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: james james
  Where is james james?
 
 Singapore
 james james
 Tags
Subject: unknow com status code
Thread ID: 232243 Message ID: 232243 # Views: 25 # Ratings: 0
Version: Visual FoxPro 8 Category: General VFP Topics
Date: Saturday, June 20, 2009 6:12:53 PM         
   


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



COMPLETE THREAD
unknow com status code Posted by james james @ 6/20/2009 6:12:53 PM
RE: unknow com status code Posted by Yousfi Benameur @ 6/20/2009 6:38:23 PM