Command line tools for testing drive mapping
From Nitix Knowledgebase
Contents
Problem
Are there any command line tools available for testing and troubleshooting drive mapping?
Solution
Net Use Command in Windows 98
NET USE [drive: | *] [\computerdirectory [password | ?]] [/SAVEPW:NO] [/YES] [/NO]
NET USE [port:] [\computerprinter [password | ?]] [/SAVEPW:NO] [/YES] [/NO]
NET USE drive: | /DELETE [/YES]
NET USE port: | /DELETE [/YES]
NET USE * /DELETE [/YES]
NET USE drive: | * /HOME
| drive | Specifies the drive letter you assign to a shared directory. |
| * | Specifies the next available drive letter. If used with /DELETE, specifies to disconnect all of your connections. |
| port | Specifies the parallel (LPT) port name you assign to a shared printer. |
| computer | Specifies the name of the computer sharing the resource. |
| directory | Specifies the name of the shared directory. |
| printer | Specifies the name of the shared printer. |
| Password | Specifies the password for the shared resource, if any. |
| ? | Specifies that you want to be prompted for the password of the shared resource. You do not need to use this option unless the password is optional. |
| /SAVEPW:NO | Specifies that the password you type should not be saved in your password-list file. You need to retype the password the next time you connect to this resource. |
| /YES | Carries out the NET USE command without first prompting you to provide information or confirm actions. |
| /DELETE | Breaks the specified connection to a shared resource. |
| /NO | Carries out the NET USE command, responding with NO automatically when you are prompted to confirm actions. |
This is a basic script that first deletes a mapped drive for Z and then remaps the resource to drive Z. You will need a net use for each resource you want to map.
net use z: /DELETE /YES (this will only delete mapped drive Z) net use * /DELETE /YES (this will delete ALL mapped drives) net use z:
Net Use Command in Windows 2000 and XP
NET USE
[devicename | *] [\computernamesharename[volume] [password | *]]
[/USER:[domainname]username]
[/USER:[dotted domain name]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]
NET USE {devicename | *} [password | *] /HOME
NET USE [/PERSISTENT:{YES | NO}]
For further details, refer to Microsoft's official documentation:
"Net use." by Microsoft. Accessed 2007-12-18.

