7 replies
by justanadmin
You can map a network printer by using the Windows Scripting Host (WSH) to run a Visual Basic script:
Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\YourServer\YourPrinterShare"
PrinterDriver = "YourPrinterDriver"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\YourServer\YourPrinterShare"
NOTE: YourPrinterDriver must exactly match the driver name in the Ntprint.inf file.
If you wish to add a different printer foreach user who logs on to Terminal Services:
Set WshNetwork = CreateObject("WScript.Network")
Select Case WshNetWork.UserName
Case "Username1"
PrinterPath = "\\YourServer\YourPrinterShare1"
PrinterDriver = "YourPrinterDriver1"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\YourServer\YourPrinterShare1"
Case "Username2"
PrinterPath = "\\YourServer\YourPrinterShare2"PrinterDriver = "YourPrinterDriver2"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\YourServer\YourPrinterShare2"
End Select
by ksandy
by ksandy
by georgevlob
The above should work, but if you want a one-liner, enter the following:
rundll32 printui.dll,PrintUIEntry /in /n \\Server\PrinterName
by ksandy
This discussion is closed to new replies.
Trending Networks posts
Sort by Trending