码迷,mamicode.com
首页 > 其他好文 > 详细

vbs脚本实现网盘映射及标签更改

时间:2020-01-03 00:18:20      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:use   null   文件   pac   cat   obj   标签   namespace   domain   

vbs脚本实现网盘映射及标签更改,完全自主研发,绝无仅有,觉得有用的朋友点个攒:

Set WshNetwork = CreateObject("WScript.Network")
set wshshell = wscript.createObject("WScript.shell")
dim mypath
mypath = "\xxx.domain.com\" //共享文件路径
if WshNetwork.UserName = "aaaa" then
elseif WshNetwork.UserName = "bbbb" then
WshNetwork.MapNetworkDrive "M:", mypath & WshNetwork.UserName
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
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
end if
strNewName = "DeptPublic"
strDriveLetter = "O:"
Set objShell = CreateObject("shell.application")
if isNull(objShell.NameSpace(strDriveLetter)) then
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
end if
strNewName = "Photo"
strDriveLetter = "P:"
Set objShell = CreateObject("shell.application")
if isNull(objShell.NameSpace(strDriveLetter)) then
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
end if
strNewName = "Video"
strDriveLetter = "V:"
Set objShell = CreateObject("shell.application")
if isNull(objShell.NameSpace(strDriveLetter)) then
objShell.NameSpace(strDriveLetter).Self.Name = strNewName
end if
\实现四个网盘的标签更改,有效隐藏网盘的实际路径,保障服务器的安全。

vbs脚本实现网盘映射及标签更改

标签:use   null   文件   pac   cat   obj   标签   namespace   domain   

原文地址:https://blog.51cto.com/77jiayuan/2463912

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!