WshNetwork.RemoveNetworkDrive

Remove a shared network drive mapping.

Syntax 
      MyObject.RemoveNetworkDrive(strName, [bForce], [bUpdateProfile])

options:

   strName : The mapped drive you want to remove.  
   
   bForce  : Force the removal of the mapped drive. 
             (boolean, default = false)
   
   bUpdateProfile : Remove the mapping from the user's profile. 
                    (boolean, default = false)

Example

   Dim WshNet
   Set WshNet = CreateObject("WScript.Network")
   WshNet.MapNetworkDrive "I:", "\\print_server\hp_01","True","jdoe","jdoepassword"
   WshNet.RemoveNetworkDrive "I:"

Related commands:

NET, net use drive - WshNetwork.MapNetworkDrive
NET, list drive mappings - WshNetwork.EnumNetworkDrives

Equivalent Windows NT command:

NET - Manage network resources


Back to the Top

Simon Sheppard
SS64.com