Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printer Status
Message
De
19/09/2010 20:08:02
Sharath Shetty
Sri Krishna Consultancy Services
Mumbai, Inde
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Printer Status
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01481905
Message ID:
01481905
Vues:
104
I want to find the printer status Like ONLINE, OFFLINE, OUT OF PAPER etc.

SYS(13) always return ready even when the printer is off ( because of spooling)

I tired the code below it shows PrinterStatus = 3 for all available printer
lcComputer = '.'
loWMIService = Getobject('winmgmts:' ;
    + '{impersonationLevel=impersonate}!\\' + lcComputer + '\root\cimv2')

*!* loInstalledPrinters = loWMIService.ExecQuery ;
    ("Select * from Win32_Printer Where PrinterStatus = '1' or PrinterStatus = '2'")

loInstalledPrinters = loWMIService.ExecQuery ;
    ("Select * from Win32_Printer ")

For Each loPrinters In loInstalledPrinters
CLEAR

? loPrinters.GetObjectText_
? loprinters.Name
 wait 
Next

RETURN
Thanks in Advance
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform