Option Explicit
Dim objNetwork, strRemotePath1, strRemotePath2
Dim strDriveLetter1, strDriveLetter2

On Error Resume Next
Set objNetwork = CreateObject(“Wscript.Network”)
Set colDrives = objNetwork.EnumNetworkDrives

‘ Desconectar unidades

For i = 0 to colDrives.Count-1 Step 2
objNetwork.RemoveNetworkDrive colDrives.Item(i)
Next

strDriveLetter1 = “Q:”
strDriveLetter2 = “R:”
strRemotePath1 = “\\server\compartilhamento1
strRemotePath2 = \\server\compartilhamento2

Set objNetwork = CreateObject(“WScript.Network”)

‘ Mapear M: and P:
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2

Wscript.Quit

Anúncios