Created
September 14, 2020 14:57
-
-
Save jimdiroffii/dc9f8d4e7cc34ffaeff49aeddacf82b7 to your computer and use it in GitHub Desktop.
Map network printers and set default printer in Windows 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim objNetwork, strLocal | |
Dim strUNCPrinter1 | |
Dim strUNCPrinter2 | |
Dim strUNCPrinter3 | |
Dim strUNCPrinter4 | |
Dim strUNCPrinter5 | |
Dim strUNCPrinter6 | |
strUNCPrinter1 = "\\<servername>\<printername>" | |
strUNCPrinter2 = "\\<servername>\<printername>" | |
strUNCPrinter3 = "\\<servername>\<printername>" | |
strUNCPrinter4 = "\\<servername>\<printername>" | |
strUNCPrinter5 = "\\<servername>\<printername>" | |
strUNCPrinter6 = "\\<servername>\<printername>" | |
Set objNetwork = CreateObject("WScript.Network") | |
objNetwork.AddWindowsPrinterConnection strUNCPrinter1 | |
objNetwork.AddWindowsPrinterConnection strUNCPrinter2 | |
objNetwork.AddWindowsPrinterConnection strUNCPrinter3 | |
objNetwork.AddWindowsPrinterConnection strUNCPrinter4 | |
objNetwork.AddWindowsPrinterConnection strUNCPrinter5 | |
objNetwork.AddWindowsPrinterConnection strUNCPrinter6 | |
objNetwork.SetDefaultPrinter strUNCPrinter1 | |
WScript.Quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment