Option Explicit
Dim objNetwork
Dim WshNetwork
Dim objFSO
Dim strUNCPrinter1

Set objNetwork = CreateObject(“WScript.Network”)
Set WshNetwork = CreateObject(“WScript.Network”)

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set WshNetwork = WScript.CreateObject(“WScript.Network”)

ON ERROR RESUME NEXT

If Not objFSO.DriveExists (“H:”) Then
WshNetwork.MapNetworkDrive “H:”, “\ServerNT\” & WshNetwork.UserName
End If
If Not objFSO.DriveExists (“T:”) Then
WshNetwork.MapNetworkDrive “T:”,”\ServerNT\Transito”
End If

strUNCPrinter1 = “\Printer\Agenti”
objNetwork.AddWindowsPrinterConnection strUNCPrinter1
objNetwork.SetDefaultPrinter strUNCPrinter1
Wscript.Quit