All pastes #947508 Raw Edit

SxanRR

public text v1 · immutable
·published 2008-03-18 15:28 UTC
rendered paste body

Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUserName, strUNCPrinter1, strUNCPrinter2, strUNCPrinter3, strUNCPrinter4, strUNCPrinter5
strDriveLetter = "U:"
strRemotePath = "\\ppapc-dc02\shares\users"
strUNCPrinter1 = "\\ppapc-dc01\HP Color Laserjet 3600n"
strUNCPrinter2 = "\\ppapc-dc01\HP1055CM"
strUNCPrinter3 = "\\ppapc-dc01\OceTDS60"
strUNCPrinter4 = "\\ppapc-dc01\HP LaserJet 5100"
strUNCPrinter5 = "\\ppapc-dc01\HPLaserJet5000"

'Shared drives'
Set objNetwork = WScript.CreateObject("WScript.Network")
strUserName = objNetwork.UserName
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _
& "\" & strUserName
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "W:" , "\\ppapc-dc02\Shares\Work"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "I:" , "\\ppapc-dc02\Shares\Install"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "G:" , "\\ppapc-dc02\Shares\Groups"

'Printers'
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter1
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter2
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter3
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter4
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter5

WScript.Quit