[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

VBS Script for mapping several printers

Does anyone have a script that can map several printers.
I created one:

' PrintersLong.vbs - Windows Logon Script.
' VBScript - Connect a network printer with AddWindowsPrinterConnection
' ------------------------------------------------------------------------------'
Option Explicit
Dim objNetwork, strUNCPrinter
strUNCPrinter = "\\zara\HP LaserJet."
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter
WScript.Echo "Check the Printers folder for : " & strUNCPrinter

WScript.Quit

' End of Windows  logon script.

When I add another printer it only maps one.
Can anyone add to this or give me another one.
thanks
0
autumn801
Asked:
autumn801
1 Solution
 
basicinstinctCommented:
This script that you "created" looks amazingly like the one written by Guy Thomas, just with the credit to him removed:

http://www.computerperformance.co.uk/Logon/LogonScript_Printer_Method.htm
0
 
orionpmCommented:
Option Explicit
Dim objNetwork, strUNCPrinter, strUNCPrinter2
strUNCPrinter = "\\zara\HP LaserJet."
strUNCprinter2 = "<path & name>"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter
objNetwork.AddWindowsPrinterConnection strUNCPrinter2
WScript.Echo "Check the Printers folder for : " & strUNCPrinter & ", " & strUNCPrinter2

WScript.Quit
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now