Type the following DOS command to map the network drive, where x: is the drive letter you want to assign to the shared folder.

net use x: \\computer name\sharename

net use command

If you need to pass in a different set of credentials, you can specify the user parameter in the command as shown below.

net use x: \\computer name\sharename /user username password

In order to make the connection to the shared folder permanent, you need to add the /Pparameter. This will ensure the drive will remain even after a restart. In some versions of Windows, you may have to use /PERSISTENT instead of /P.

net use x: \\computer name\sharename /P:Yes

You can delete a mapped network drive using the command prompt by typing in the command below. You can delete all mapped drives in one go using the * instead of a drive letter.

net use x: /delete

net use * /delete