Converting the Windows Script Host RemoveNetworkDrive Method

Definition: Removes a shared network drive from your computer system.

RemoveNetworkDrive

Neither Windows PowerShell nor the .NET Framework includes a mechanism for removing a mapped network drive from your computer. Fortunately, though, the command-line utility Net.exe does provide a way for you to remove a mapped network drive from your computer. Want to get rid of drive Z? Then just call Net.exe, using the following syntax:

net use z: /delete

See conversions of other Windows Script Host methods and properties.
Return to the VBScript to Windows PowerShell home page