Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the default printer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00408792
Message ID:
00408886
Vues:
15
>You can use WSH to do this:
>
>WshNetwork=CreateObject("WScript.Network")
>WshNetwork.SetDefaultPrinter("\\Server\Print1")
>

NB: the printer must have been installed, or you may trigger a driver install dialog.

>This is straight conversion from VB code but should work.
>
>
>>Hi all:
>>How can I change the default windows printer using a WIN32API?
>>SET PRINTER TO NAME "prt-name" doesn´t change permanently.
>>
>>TIA
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
Répondre
Fil
Voir

Click here to load this message in the networking platform