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
//实现四个网盘的标签更改,有效隐藏网盘的实际路径,保障服务器的安全。服务器