应该像 用户登录后,运行在登录脚本中添加的vbs登录脚本,该脚本通过csv运行,并且仅在用户名与登录用户相同的位置进行映射。
我试过了
on error resume next
strCSV = "c:\name.csv"
$network = New-Object -ComObject WScript.Network
$network.MapNetworkDrive($Driveletter, $share, $username)
其中csv包含
User,Driveletter,share
jack,Y:, S:,"\\server\Lincoln", "\\server\share"
Tim,Z:,"\\Server\Google"
Victor,U:, V:, X:,"\\server\home","\\server\share","\\server\share"
不能有人帮忙吗?
答案 0 :(得分:1)
FileSystemObject
逐行读取文件。如果您可以使用Powershell,则可以使用$SomeVarName = Import-CSV -Path "c:\name.csv"
有效的CSV文件是:
User,Driveletter,share
jack,Y:,"\\server\Lincoln"
jack,S:,"\\server\share"
Tim,Z:,"\\Server\Google"
Victor,U:,"\\server\home"
Victor,V:,"\\server\share"
Victor,X:,"\\server\share"