Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If you have a shared local printer, can you test?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
If you have a shared local printer, can you test?
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01239774
Message ID:
01239774
Vues:
48
Hi everybody,

Can you please test the following code:
#define CRLF chr(13) + chr(10)
strComputer = "."
 objWMIService = GetObject("winmgmts:" + "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
colShares = objWMIService.ExecQuery("SELECT * FROM Win32_Share") 
FOR EACH loShare IN colShares
   =MESSAGEBOX('Name: ' + loShare.Name + ;
CRLF + 'Description: '+   loShare.Description + ;
CRLF + 'Path:' + loShare.Path)
next
The idea is to figure if the local printer is shared. However, I don't have local printer to test.

-------------------
Never mind, it's easy to use from Win32_Printer and Share_Name. I didn't find this property myself.
If it's not broken, fix it until it is.


My Blog
Répondre
Fil
Voir

Click here to load this message in the networking platform