æ¯éè¿ç»çç¥æ§è¡å¼æºèæ¬ï¼æ å°å¤ä¸ªç½ç»é©±å¨å¨çï¼
èæ¬å¦ä¸ï¼ä¿å为VBSå³å¯ï¼
1ãæ¤èæ¬ä½ç¨æ¯æ å°æ件æå¡å¨ä¸çä¸ä¸ªå
±äº«æ件夹"临æ¶äº¤æµ,å½æ1,å½æ"
On error resume next
strRemoteIP = "\\10.15.0.5\"
strfolder = "临æ¶äº¤æµ,å½æ1,å½æ"
strNewNames = split(strfolder,",")
For x = 0 To UBound(strNewNames) Step 1
Set objNetwork = CreateObject("Wscript.Network")
Set colDrives = objNetwork.EnumNetworkDrives
For i = 0 to colDrives.Count-1 Step 2
strDriveLetter = Chr(Asc(Left(colDrives.Item(i),1))-1) & ":"
Next
If strDriveLetter= "" Then strDriveLetter="Z:"
' Section to map the network drive
Set objNetwork = CreateObject("WScript.Network")
strRemotePath = strRemoteIP & strNewNames(x)
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
' Section which actually (re)names the Mapped Drive
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strNewNames(x)
next
2ãè·ç¬¬1ç§æ
åµç»æä¸å¤ªä¸æ ·ï¼æµè¯ä¸ä¸å°±ç¥éäºï¼
Set WshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "x:", "\\Fileserver01\Users$\" & wshNetwork.UserName
wshNetwork.MapNetworkDrive "z:", "\\Fileserver01\department$\it"
wshNetwork.MapNetworkDrive "y:", "\\Fileserver01\company$"
温馨提示:内容为网友见解,仅供参考