以下脚本可在网络上找到,非常适合在 Windows 7 中映射网络驱动器。
我想做的是在同一脚本中添加另一个映射驱动器,但我不熟悉 VBS 脚本,因此寻求您的专家建议!
非常感谢!
担
' MNDArguments.vbs
' VBScript to map a network drive with all 5 arguments.
' Author Guy Thomas http://computerperformance.co.uk/
' Version 1.3 - April 24th 2010
' ---------------------------------------------------------'
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile
' Values of variables set
strDriveLetter = "H:"
strRemotePath = "\\alan\home"
strUser = "guytom"
strPassword = "P@ssw0rd1"
strProfile = "false"
' This section creates a network object. (objNetwork)
' Then apply MapNetworkDrive method. Result H: drive
' Note, this script features 5 arguments on lines 21/22.
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, _
strProfile, strUser, strPassword
WScript.Quit
' End of Example script .