NET命令

来源:互联网 发布:交互设计软件 html 编辑:程序博客网 时间:2024/05/17 06:58
net use 列出本机网络连接 
net use [url=file:////IP/ipc$]//IP/ipc$[/url] "密码" /user:"帐号" 建立与指定IP的IPC$(空连接) 
net use z: [url=file:////IP/c$]//IP/c$[/url] "密码" /user:"帐号" 将对方的c盘映射为自己的z盘 
net use [url=file:////IP/ipc$]//IP/ipc$[/url] /del 删除与指定IP的IPC$连接 
net use z: /del 删除本机映射的z盘 
net use * /del 删除本机所有映射和IPC$连接 
如提示:提供的凭据与已存在的凭据冲突, net use * /del 即可 
Net use 
将计算机连接到某个共享资源或与其断开连接,或者显示有关计算机连接的信息。该命令还控制永久性网络连接。在没有参数的情况下使用,net use 可以检索网络连接列表。 
语法 
net use [{DeviceName | *}] [{//ComputerName[/ShareName[/Volume]]] |[http://ComputerName/ShareName[/Folder]}] [{Password | *}]] [/userscreen.width-300)this.width=screen.width-300'>DomainName/]UserName] [/userscreen.width-300)this.width=screen.width-300'>DottedDomainName/]UserName] [/userscreen.width-300)this.width=screen.width-300'>UserName@DottedDomainName] [/savecred] [/smartcard] [{/delete | /persistent:{yes | no}}] 
net use [DeviceName [/home[{Password | *}] [/delete:{yes | no}]] 
net use [/persistent:{yes | no}] 
参数 
DeviceName 
指派名称以连接到资源,或指定要断开连接的设备。有两种类型的设备名称:磁盘驱动器(即 D: 到 Z:)和打印机(即 LPT1: 到 LPT3:)。键入星号 (*) 代替指定的设备名称来指派下一个可用的设备名称。 
[url=file:////ComputerName/ShareName]//ComputerName/ShareName[/url] 
指定服务器和共享资源的名称。如果 ComputerName 包含空格,请使用引号将整个计算机名引起来,从 // 开始到计算机名的末尾(如 "[url=file:////Computer]//Computer[/url] Name/Share Name")。计算机名可以有 1 到 15 个字符。如果省略了 /ShareName,便会尝试连接到 ipc$ 共享。 
/Volume 
指定服务器上的 NetWare 卷。必须安装并运行“NetWare 客户端服务”以连接到 NetWare 服务器。 
http://ComputerName/ShareName[/Volume
指定 WebDAV 服务器和共享资源的名称。如果 ComputerName 包含空格,请使用引号将整个计算机名引起,即从 http 前缀 (http://) 到计算机名的末尾。 
Password 
指定访问共享资源所需的密码。键入星号 (*) 将给出密码的提示。在密码提示符下键入密码时不显示密码。 
/user 
指定用其建立连接的其他用户名。该参数不可与 /savecred 配合使用。 
DomainName 
指定其他的域。如果忽略 DomainName,则 net use 将使用当前登录到的域。 
UserName 
指定登录时使用的用户名。 
DottedDomainName 
为用户帐户所在的域指定完全合格的域名。 
/savecred 
如果系统提示用户输入密码,请存储提供的凭据以便再使用。该参数不可与 /smartcard 或 /user 配合使用。 
/smartcard 
指定网络连接要使用智能卡上的凭据。如果多个智能卡可用,则将要求您指定凭据。该参数不可与 /savecred 配合使用。 
/delete 
取消指定的网络连接。如果用星号 (*) 指定连接,则将取消所有网络连接。 
/persistent:{yes | no} 
控制永久性网络连接的使用。默认值是最近一次所用的设置。无设备的连接不是永久性连接。Yes 将在连接完成后保存所有连接,并在下一次登录时恢复这些连接。No 不保存正在进行的连接或后续连接。现有的连接将在下次登录时恢复。使用 /delete 可以删除永久性连接。 
/home 
将用户连接到主目录。 
net helpCommand 
显示指定 net 命令的帮助。 
注释 
? 使用 net use 可以连接到网络资源以及从中断开连接,并查看当前与网络资源的连接。如果将共享目录用作当前驱动器,或者某个活动进程正在使用共享目录,则无法从共享目录中断开连接。 
? 要查看关于某个连接的信息,可以执行下列任何一种操作: 
? 键入 net useDeviceName 以获得有关某个特定连接的信息。 
? 键入 net use 以获得所有计算机连接的列表。 
? 无设备的连接不是永久性连接。 
? 在安装并运行“Netware 客户服务”后,则可以连接到 Novell 网络上的 Netware 服务器。使用连接到 Windows Networking 服务器时所用的相同语法,但是必须包括要连接的卷。 
? 如果提供的 ServerName 包含空格,请在文本两边使用引号(即 "Server Name")。如果忽略引号,将出现错误消息。 
示例 
要将磁盘驱动器设备名 E: 分配到[url=file:////Financial]//Financial[/url] 服务器上的 Letters 共享的目录,请键入: 
net use e://financial/letters 
要将磁盘驱动器设备名称 M: 分配到(映射到)[url=file:////Financial]//Financial[/url] NetWare 服务器上 Letters 卷内的目录 Mike,请键入: 
net use m://financial/letters/mike 
要连接用户标识符 Dan,并使该连接看似从“Accounts”域中完成,请键入: 
net use d://server/share /user:Accounts/Dan 
要使用 Passport 帐户 [email=UserName@passport.com]UserName@passport.com[/email] 将磁盘驱动器设备名 F: 分配到名为 TargetName 的 MSN Internet 访问社区中的文件包,请键入: 
net use f:http://www.msnusers.com/TargetName /user:UserName@passport.com 
要从 [url=file:////Financial/Public]//Financial/Public[/url] 目录断开连接,请键入: 
net use f://financial/public /delete 
要连接到在 [url=file:////Financial]//Financial[/url] 2 服务器上共享的资源备忘录,请键入: 
net use k:"[url=file:////financial]//financial[/url] 2" /memos 
要在每次登录时恢复当前连接而不考虑以后的变化,请键入: 
net use /persistent:yes
原创粉丝点击