PDA

View Full Version : Set a default 'LOCAL' Printer (W2K)


g707
05-21-2002, 09:27 PM
I see a lot of people asking this question for setting a default network printer using WshNetwork.SetDefaultPrinter .
Is their a function or way to set a default printer that is setup locally?
When I say locally, it not using an LPT port, but rather a Local Port with a .spl spool file. (Like a local fax print driver)
And would you code it to access a specific local spool file?
Thanks.

*******
* g707 *
*******

g707
05-21-2002, 09:42 PM
Dis-reguard this question.
It looks like you can the WshNetwork.SetDefaultPrinter on local printers also.
I had a simple syntax error that stopped it from running correctly.
Local syntax
Set wn = WScript.CreateObject("WScript.Network")
wn.SetDefaultPrinter"Name of Local Printer"
OR
Network syntax
Set wn = WScript.CreateObject("WScript.Network")
wn.SetDefaultPrinter"\\computername\printername"

*******
* g707 *
*******<P ID="edit"><FONT class="small">Edited by g707 on 05/21/02 16:43.</FONT></P>