vbs腳本實現網盤映射及標籤更改

vbs腳本實現網盤映射及標籤更改,徹底自主研發,絕無僅有,以爲有用的朋友點個攢:shell

Set WshNetwork = CreateObject("WScript.Network")
set wshshell = wscript.createObject("WScript.shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Dim mypath
mypath = "\xxx.domain.com\" //共享文件服務器路徑
if fso.FolderExists(mypath & WshNetwork.UserName) then
WshNetwork.MapNetworkDrive "M:", mypath & WshNetwork.UserName
end if
//每一個人映射我的網盤
if WshNetwork.UserName = "aaaa" then
elseif WshNetwork.UserName = "bbbb" then
WshNetwork.MapNetworkDrive "O:", mypath & "wl_information_dept"
WshNetwork.MapNetworkDrive "V:", mypath & "video"
WshNetwork.MapNetworkDrive "P:", mypath & "photo"
//當用戶名爲bbbb時映射三個網盤
elseif WshNetwork.UserName = "cccc" then
else
end if
wscript.sleep 1000安全

strNewName = "My"
strDriveLetter = "M:"
Set objShell = CreateObject("shell.application")
if isNull(objShell.NameSpace(strDriveLetter)) then
else
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
end if
strNewName = "DeptPublic"
strDriveLetter = "O:"
if isNull(objShell.NameSpace(strDriveLetter)) then
else
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
end if
strNewName = "Photo"
strDriveLetter = "P:"
Set objShell = CreateObject("shell.application")
if isNull(objShell.NameSpace(strDriveLetter)) then
else
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
end if
strNewName = "Video"
strDriveLetter = "V:"
Set objShell = CreateObject("shell.application")
if isNull(objShell.NameSpace(strDriveLetter)) then
else
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
end if
//實現四個網盤的標籤更改,有效隱藏網盤的實際路徑,保障服務器的安全。服務器

相關文章
相關標籤/搜索