Mapping a network drive and checking for its existence in VBScript
问题 I need to map a network drive into a network path using VBScript. The network path is read directly from input. How should I map the network drive and how to check whether the entered network path already exists? 回答1: I created a subroutine to map drives... MapDrive "H:","\\server\share" Sub MapDrive(letter, uncpath) on error Resume Next dim drivetype, currentmapping dim objWMIService dim colDisks, objDisk 'Set wshnetwork = CreateObject("Wscript.Network") Set objWMIService = GetObject(