ana sayfa > VBScript > Vb script – MapNetworkDrive

Vb script – MapNetworkDrive

Option Explicit

Dim objNetwork, objFSO, objShell

Dim strDriveLetter, bForce, bUpdateProfile, strNewName
strDriveLetter = "Z:"
bForce = "True"
bUpdateProfile = "True"
strNewName = "\\bıdıbıdı\folder"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")

If (objFSO.DriveExists(strDriveLetter) = True) Then
objNetwork.RemoveNetworkDrive strDriveLetter, True, True
End If
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strNewName

Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strNewName

' Wscript.Echo "Check : "& strDriveLetter & " for " & strNewName
WScript.Quit

 

Categories: VBScript Tags:
  1. şimdilik yorum yok.
  1. şimdilik geri bağlantı yok
yorum yapabilmek için giriş yapmalısınız