.RemoveNetworkDrive

Remove a shared network drive mapping.

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

Key
   objNetwork : A WScript.Network object

   strName    : The mapped drive you want to remove.
   
   bForce     : Force the removal of the mapped drive (TRUE/FALSE).
   
   bUpdateProfile : Remove the mapping from the user’s profile (TRUE/FALSE).

Examples

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

“No problem is so formidable that you can’t walk away from it” ~ Charles M. Schulz

Related VBScript commands

Map drive - .MapNetworkDrive
List drive mappings - .EnumNetworkDrives
Equivalent Windows CMD command: NET - Manage network resources.


 
Copyright © 1999-2024 SS64.com
Some rights reserved