Академический Документы
Профессиональный Документы
Культура Документы
htm
domainname = Specify a different domain than the one you're on, assuming you're on one, with this
option. Skip domainname if you're not on a domain or you want net use to use the one you're on
already.
username = Use this option with /user to specify the username to use to connect to the shared
resource.
dotteddomainname = This option specifies the fully qualified domain name where username exists.
/home = This net use command option maps the current user's home directory to either the
devicename drive letter or the next available drive letter with *.
/persistent:{yes | no} = Use this option to control the persistence of connections created with the
net use command. Choose yes to automatically restore created connections at the next logon or
choose no to limit the life of this connection to this session. You can shorten this switch to /p if you
like.
/smartcard = This switch tells the net use command to use the credentials present on the available
smart card.
/savecred = This option stores the password and user information for use next time you connect in
this session or in all future sessions when used with /persistent:yes.
/delete = This net use command is used to cancel a network connection. Use /delete with
devicename to remove a specified connection or with * to remove all mapped drives and devices.
This option can be shortened to /d.
/help = Use this option, or the shortened /h, to display detailed help information for the net use
command. Using this switch is the same as using the net help command with net use: net help use.
/? = The standard help switch also works with the net use command but the only displays the
command syntax, not any detailed information about the command's options.
Tip: You can save the output of the net use command to a file using a redirection operator. See How
To Redirect Command Output to a File for help doing that, or see Command Prompt Tricks for this
and more tips.
In this example, I used the net use command to connect to the my media shared folder on a
computer named server. The my media folder will be mapped to my highest free drive letter [*],
which for me happens to be y:, but I don't want to continue mapping this drive every time I log on
to my computer [/persistent:no].
net use e: \\usrsvr002\smithmark Ue345Ii /user:pdc01\msmith2 /savecred /p:yes
Here's a slightly more complicated example that you might see in a business setting.
In this net use example, I want to map my e: drive to the smithmark shared folder on usrsvr002. I
want to connect as another user account I have [/user] by the name of msmith2 that's stored on the
pdc01 domain with a password of Ue345Ii. I don't want to map this drive manually every time I
start my computer [/p:yes] nor do I want to enter my username and password each time
[/savecred].
net use p: /delete
I suppose an appropriate final example of net use would be the removal [/delete] of a currently
mapped drive, in this case p:.