1. Home
  2. Docs
  3. Scense Embedded Scripting...
  4. Scense Scripting Examples
  5. Printers

Printers

Sample script for connecting network printers and set the default printer.

Connect network printer

This script will connect a network printer and set it as the default printer.

Sub Scense_Main()
    'Instantiate Network Printing object
    Set NetPrint = CreateObject("WScript.Network")
    
    'Connect printers
    NetPrint.AddWindowsPrinterConnection "\\Server\Printer"
    
    'Set default printer
    NetPrint.SetDefaultPrinter "\\Server\Printer"
        
    'Clean Up
    Set NetPrint = Nothing    
End Sub