Windows has a useful command called Net use that allows you to access network drives and manage them from CMD. A drive should be mapped to a shared folder, right? Do you want to delete them? Enter ‘Net use’ for that.
Net Use Command Example –
Here’s an example of the syntax you can use.
Using the command line to map network drives:
Consider a situation where you want to map a \RemotePC\Share to a local drive. Below is a command that does that.
Net use * \\RemotePC\Share
If we replace ‘*’ with the drive name, the share would be mapped to the first available drive beginning with Z.
There has been an error 85 with the system:
The error indicates that you’re trying to map to a network drive that doesn’t exist (a shared drive already exists).
c:\>net use Z: \\remptepc\share System error 85 has occurred. The local device name is already in use.
You can specify user names and passwords in the command line by referring to the Map network drive from the command line for advanced options for using the network.
A mapped drive (Delete/Disconnect):
Using the ‘net use /delete’ command, you can disconnect mapped drives. In this case, the command is ‘net use /delete Z:’.
net use Z: /delete
Delete all network drives mapped to the network:
with the command below.
net use * /delete
Mapped shares and network drives.
c:\>net use New connections will be remembered. Status Local Remote Network ------------------------------------------------------------------------------- Z: \\remotepc\share Microsoft Windows Network The command completed successfully.
Read Also: Event Viewer Command Line [CMD] 2022