Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer Status
Message
 
 
To
19/09/2010 20:08:02
Sharath Shetty
Sri Krishna Consultancy Services
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01481905
Message ID:
01481914
Views:
47
>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

Unfortunately, as far as I know, there is no way to find this info reliably.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform