[ Last edited by wudixin96 on 2007-9-2 at 04:53 PM ]作者: beyoungse 时间: 2007-9-2 17:07 VBS 中怎么用变量?作者: wudixin96 时间: 2007-9-2 17:30 Set objComputer = CreateObject("Shell.LocalMachine")
Set objNet = CreateObject("Wscript.Network")
strCompName = objnet.ComputerName
Set objNetwork = CreateObject("Wscript.Network")
strNewName = "data"
' Section to map the network drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "d:","\\server\A"strCompName"$","A"strCompName"","A"strCompName""
' Section which actually (re)names the Mapped Drive
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strNewName作者: slore 时间: 2007-9-2 21:02 "d:","\\server\A"strCompName"$","A"strCompName"","A"strCompName""
' Section to map the network drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "d:","\\server\A" & strCompName & "$",,"A" & strCompName, "A" & strCompName
' Section which actually (re)names the Mapped Drive
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strNewName