Removes a shared network drive from your computer system.
|
---|
object.RemoveNetworkDrive(strName, [bForce], [bUpdateProfile]) |
Arguments
- object
WshNetwork object.
- strName
String value indicating the name of the mapped drive you want to remove. The strName parameter can be either a local name or a remote name depending on how the drive is mapped.
- bForce
Optional. Boolean value indicating whether to force the removal of the mapped drive. If bForce is supplied and its value is true, this method removes the connections whether the resource is used or not.
- bUpdateProfile
Optional. String value indicating whether to remove the mapping from the user's profile. If bUpdateProfile is supplied and its value is true, this mapping is removed from the user profile. bUpdateProfile is false by default.
Remarks
Example
The following code removes the logical drive "E."
Visual Basic Script | Copy Code |
---|
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork. RemoveNetworkDrive"E:" |
JScript | Copy Code |
---|
var WshNetwork = WScript.CreateObject("WScript.Network");
WshNetwork.RemoveNetworkDrive ("E:"); |
See Also