Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default Windows Printer (Strange problem)
Message
De
12/09/2000 04:14:27
 
 
À
11/09/2000 06:22:01
Information générale
Forum:
Visual Basic
Catégorie:
Fonctions API de Windows
Divers
Thread ID:
00414797
Message ID:
00415296
Vues:
19
>Hello.
>I write code for Set default windows printer
>I have strange problem. When I place MSGBOX("Run") in method.. I see.. Default printer was set. But If I rem MSGBOX() the old printer stay as default.
>Can you explain that?


The easy solution is to use the Wscript.Network automation object:

oNet = CREATEOBJ('wscript.network')
oNet.SetDefaultPrinter(Windows Printer Name from AGETPRINTER())

Requires instalation of WSH 2.0 or later; works fine for me, regardless of platform.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform