Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the default printer
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00408792
Message ID:
00408886
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform