WSH » wshnetwork » SetDefaultPrinter

Syntax:
WshNetwork.SetDefaultPrinter (strPrinterName)
strPrinterName
Receives the name of the printer resource that will be identified as the default printer.

The SetDefaultPrinter method sets the default printer to the specified printer.

Examples

Code:
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.SetDefaultPrinter "\\Server\LaserJet"
Explanation:

This VBScript code sets the default printer to \\Server\LaserJet.

Language(s): VBScript