命令行大全

net

舞夕之 发表于 2020-06-28 17:47浏览次数:

net命令用于更新或修复网络或查看其设置。

查看英文版

目录:

1 net 运行系统环境

2 net 语法

3 net 示例

net 运行系统环境

Windows 95

Windows 98

Windows xp

Windows vista

Windows 2000

Windows 7

Windows 8

Windows 10

Windows NT

Windows ME

net 语法

语法:Windows Vista、7、8和10

net [ accounts | computer | config | continue | file | group | help | helpmsg | localgroup 
| pause | session | share | start | statistics | stop | time | use | user | view ]
NET ACCOUNTS 调整帐户设置

[/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length]
[/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days]
[/UNIQUEPW:number] [/DOMAIN]

NET COMPUTER 添加其他具有Windows域控制器的联网计算机。

\\computername {/ADD | /DEL}

NET CONFIG 显示您当前的服务器或工作组设置。

[SERVER | WORKSTATION]

NET CONTINUE 继续使用服务

[service]

NET FILE 显示服务器上打开的共享文件。

[id [/CLOSE]]

NET GROUP 添加、删除、查看和管理网络工作组。

[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname username [...] {/ADD | /DELETE} [/DOMAIN]

NET LOCALGROUP 添加、删除、查看和管理网络组。

[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]

NET NAME 创建或删除用于消息传递的名称。

[name [/ADD | /DELETE]]

NET PAUSE 暂停指定的网络服务。

[service]

NET SESSION 显示连接到计算机的所有会话,并删除它们(如果指定)。

[\\computername] [/DELETE]

NET SHARE 创建和管理本地网络共享。

sharename
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents| Programs | None ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents | Programs | None]
{sharename | devicename | drive:path} /DELETE

NET START 启动指定的网络服务。

[service]

NET STATISTICS 显示工作站或服务器的网络统计信息。

[WORKSTATION | SERVER]

NET STOP 停止指定的网络服务。

service

NET TIME 显示另一台网络计算机的时间和日期。

[\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET]
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]

NET USE 连接或断开您的计算机与共享资源的连接,或显示有关您的连接的信息。

[devicename | *] [\\computername\sharename[\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}]

NET USER 显示计算机或域上的用户。

[username [password | *] [options]] [/DOMAIN]
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]

NET VIEW 显示指定工作组中的计算机列表或指定计算机上可用的共享资源。

[\\computername [/CACHE] | /DOMAIN[:domainname]]
NET VIEW /NETWORK:NW [\\computername]

Windows XP 语法

NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG | LOCALGROUP 
| NAME | PAUSE | PRINT | SEND | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
NET ACCOUNTS 调整帐户设置

[/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length]
[/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days]
[/UNIQUEPW:number] [/DOMAIN]

NET COMPUTER 添加其他具有Windows域控制器的联网计算机。

\\computername {/ADD | /DEL}

NET CONFIG 显示您当前的服务器或工作组设置。

[SERVER | WORKSTATION]

NET CONTINUE 继续使用服务。

[service]

NET FILE 显示服务器上打开的共享文件。

[id [/CLOSE]]

NET GROUP 添加、删除、查看和管理网络工作组。

[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname username [...] {/ADD | /DELETE} [/DOMAIN]

NET LOCALGROUP 添加、删除、查看和管理网络组。

[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]

NET NAME 创建或删除用于消息传递的名称。

[name [/ADD | /DELETE]]

NET PAUSE 暂停指定的网络服务。

[service]

NET PRINT 管理网络打印作业。

\\computername\sharename
[\\computername] job# [/HOLD | /RELEASE | /DELETE]

NET SEND 向网络上的其他用户、计算机或消息传递名称发送消息。Messenger服务必须正在运行才能接收消息。

您只能向网络上处于活动状态的名称发送邮件。如果消息发送给用户名,则该用户必须登录并运行Messenger服务才能接收消息。

{name | * | /DOMAIN[:name] | /USERS} message

NET SESSION 显示连接到计算机的所有会话,并删除它们(如果指定)。

[\\computername] [/DELETE]

NET SHARE 创建和管理本地网络共享。

sharename
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents| Programs | None ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents | Programs | None]
{sharename | devicename | drive:path} /DELETE

NET START 启动指定的网络服务。

[service]

NET STATISTICS 显示工作站或服务器的网络统计信息。

[WORKSTATION | SERVER]

NET STOP 停止指定的网络服务。

service

NET TIME 显示另一台网络计算机的时间和日期。

[\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET]
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]

NET USE 连接或断开您的计算机与共享资源的连接,或显示有关您的连接的信息

[devicename | *] [\\computername\sharename[\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}]

NET USER 显示计算机或域上的用户

[username [password | *] [options]] [/DOMAIN]
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]

NET VIEW 显示指定工作组中的计算机列表或指定计算机上可用的共享资源。

[\\computername [/CACHE] | /DOMAIN[:domainname]]
NET VIEW /NETWORK:NW [\\computername]

Windows 2000 语法

NET [ CONFIG | DIAG | HELP | INIT | LOGOFF | LOGON | PASSWORD | PRINT | SEND | SHARE | START 
| STOP | TIME | USE | VER | VIEW ]
NET CONFIG 显示您当前的工作组设置。

NET CONFIG [/YES]

/YES 执行net config命令时不带。
首先提示您提供信息或。
确认操作。
NET DIAG 运行Microsoft网络诊断程序以测试两台计算机之间的硬件连接并显示有关单台计算机的信息。
NET DIAGNOSTICS [/NAMES | /STATUS]
/NAMES 指定诊断服务器名称,以避免多个用户同时使用Net DIAG时的冲突。此选项仅在网络使用NetBIOS协议时有效。
/STATUS 使您能够指定需要网络诊断信息的计算机。
NET HELP 显示有关网络命令和错误消息的信息。

command /?
NET HELP [suffix]
NET HELP errornum

command /? 指定需要其相关信息的Microsoft Net命令。
suffix 指定要了解其信息的命令的第二个单词。例如,net view的后缀是view。
errornum 指定要获取其信息的错误消息的编号。
NET INIT 加载协议和网络适配器驱动程序,而不将其绑定到协议管理器。如果您使用的是第三方网络适配器驱动程序,则可能需要此命令。然后,您可以通过键入net start NETBIND将驱动程序绑定到协议管理器。

NET INITIALIZE [/DYNAMIC]

/DYNAMIC 动态加载对某些第三方网络(如Banyan Vines)有用的协议管理器,以解决内存问题。
NET LOGOFF 断开您的计算机与其所连接的共享资源之间的连接。

NET LOGOFF [/YES]

/YES 在不首先提示您提供信息或确认操作的情况下执行Net Logoff命令。
Net Logon将您标识为工作组的成员。

NET LOGON [user [password | ?]] [/DOMAIN:name] [/YES] [/SAVEPW:NO]

user 指定在工作组中标识您的名称。您指定的名称最多可以包含20个字符。
password 授权您访问密码列表文件的唯一字符串。密码最多可包含14个字符。
? 指定要提示您输入密码。
/DOMAIN 指定要登录到Microsoft Windows NT或LAN Manager域。该名称指定要登录到的Windows NT或LAN Manager域。
/YES 执行Net Logon命令,而不首先提示您提供信息或确认操作。
/SAVEPW:NO 执行net logon命令,而不提示您创建密码列表文件。

如果希望系统提示您输入用户名和密码,而不是在net logon命令行中指定它们,请键入不带选项的net logon。

NET PASSWORD 更改您的登录密码。

NET PASSWORD [oldpassword [newpassword]]
NET PASSWORD \\computer | /DOMAIN:name [user [oldpassword [newpassword]]]

oldpassword 指定您的当前密码。
newpassword 指定新密码。它最多可以包含14个字符。
computer 指定要更改密码的Windows NT或LAN Manager服务器。
/DOMAIN 指定要更改您的
Windows NT或LAN Manager域上的密码。
名称指定要在其上更改密码的Windows NT或LAN Manager域。
user 指定您的Windows NT或LAN Manager用户名。

上面的第一个语法行用于更改密码列表文件的密码。上面的第二个语法行用于更改Windows NT或LAN Manager服务器或域上的密码。

NET PRINT 显示有关打印队列和控制打印作业的信息。

NET PRINT \\computer[\printer] | port [/YES]
NET PRINT \\computer | port [job# [/PAUSE | /RESUME | /DELETE]] [/YES]

computer 指定要获取其打印队列信息的计算机的名称。
printer 指定要获取其信息的打印机的名称。
port 指定计算机上连接到需要其信息的打印机的并行端口(LPT)的名称。
job# 指定分配给排队打印作业的编号。您可以指定下面的选项。
/PAUSE 暂停打印作业。
/RESUME 重新启动暂停的打印作业。
/DELETE 取消打印作业。
/YES 在不首先提示您提供信息或确认操作的情况下执行Net Print命令。

使用Net Print指定计算机名称时,您会收到有关连接到该计算机的每台共享打印机上的打印队列的信息。

NET SEND NET SEND {name | * | /DOMAIN[:name] | /USERS} message

向网络上的其他用户、计算机或消息传递名称发送消息。必须运行Messenger服务才能接收消息。
您只能向网络上处于活动状态的名称发送邮件。如果消息发送给用户名,则该用户必须登录并运行Messenger服务才能接收消息。

name 要发送邮件的用户名、计算机名或邮件名。如果名称是包含空白字符的计算机名称,请用引号(“”)将别名引起来。
* 将邮件发送给您组中的所有姓名。
/DOMAIN[:name] 将消息发送到工作站域中的所有名称。如果指定了NAME,则消息将发送到指定域或工作组中的所有名称。
/USERS 将消息发送给连接到服务器的所有用户。
message 要作为消息发送的文本。
NET SHARE NET SHARE sharename
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Automatic | No ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Automatic | No ]
{sharename | devicename | drive:path} /DELETE
NET START Starts services 注意:不能从Windows中的命令提示符启动服务。

NET START [BASIC | NWREDIR | WORKSTATION | NETBIND | NETBEUI | NWLINK] [/LIST] [/YES] [/VERBOSE]

BASIC 启动基本重定向器。
NWREDIR 启动Microsoft Novell兼容重定向器。
WORKSTATION 启动默认重定向器。
NETBIND 绑定协议和网络适配器驱动程序。
NETBEUI 启动NetBIOS界面。
NWLINK 启动IPX/SPX兼容接口。
/LIST 显示正在运行的服务的列表。
/YES 在不首先提示您提供信息或确认操作的情况下执行Net Start命令。
/VERBOSE 在加载设备驱动程序和服务时显示有关它们的信息。

要启动在安装过程中选择的工作组重定向器,请键入NET START,不带选项。 通常,您不需要使用任何选项。

停止服务 注意:不能从Windows中的命令提示符停止服务。
NET STOP [BASIC | NWREDIR | WORKSTATION | NETBEUI | NWLINK] [/YES]
NET STOP 停止基本重定向程序。
BASIC 停止基本重定向程序。
NWREDIR 停止与Microsoft Novell兼容的重定向程序。
WORKSTATION 停止默认重定向程序。
NETBEUI 停止NetBIOS接口。
NWLINK 停止IPX/SPX兼容接口。
/YES

在不首先提示您提供信息或确认操作的情况下执行NET STOP命令。

要停止工作组重定向程序,请输入NET stop without options。此命令将断开与共享资源的所有连接,并从计算机内存中删除网络命令。

NET TIME显示工作组、Windows NT、Windows 95或NetWare时间服务器上的时间,或将计算机的时钟与Microsoft Windows上的共享时钟同步。

NET TIME [\\computer | /WORKGROUP:wgname] [/SET] [/YES]

computer 指定要检查其时间或用于同步计算机时钟的计算机(时间服务器)的名称。
/WORKGROUP 指定要在另一个工作组中的计算机(时间服务器)上使用时钟。
wgname 指定包含要检查其时钟或用于同步计算机时钟的计算机的工作组的名称。如果该工作组中有多个时间服务器,则NET time使用它找到的第一个时间服务器。
/SET 将计算机的时钟与指定的计算机或工作组上的时钟同步。
/YES 执行NET TIME命令,而不首先提示您提供信息或确认操作。
NET USE 连接或断开计算机与共享资源的连接,或显示有关连接的信息。

NET USE [drive: | *] [\\computer\directory [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]
NET USE [port:] [\\computer\printer [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]

NET USE drive: | \\computer\directory /DELETE [/YES]
NET USE port: | \\computer\printer /DELETE [/YES]
NET USE * /DELETE [/YES]

NET USE drive: | * /HOME

drive 指定分配给共享目录的驱动器号。
* 指定下一个可用的驱动器号。如果与/DELETE一起使用,则指定断开所有连接
port 指定分配给共享打印机的并行(LPT)端口名。
computer 指定共享资源的计算机的名称。
directory 指定共享目录的名称。
printer 指定共享打印机的名称。
password 指定共享资源的密码(如果有)。
? 指定要提示您输入共享资源的密码。除非密码是可选的,否则不需要使用此选项。
/SAVEPW:NO 指定不应将键入的密码保存在密码列表文件中。下次连接到此资源时,需要重新键入密码。
/YES 执行NET USE命令,而不首先提示您提供信息或确认操作。
/DELETE 断开与共享的指定连接资源
/NO 执行NET USE命令,在系统提示您确认操作时不自动响应NO。
/HOME 如果在LAN管理器或Windows NT用户帐户中指定了主目录,则建立与该目录的连接。

要列出所有连接,请输入NET USE without options

NET VER 显示正在使用的工作组重定向程序的类型和版本号。

NET VER

NET VIEW 显示指定工作组中的计算机列表或指定计算机上可用的共享资源。

NET VIEW [\\computer] [/YES]
NET VIEW [/WORKGROUP:wgname] [/YES]

computer 指定要列出其共享资源的计算机的名称。
/WORKGROUP 指定要查看共享资源的另一个工作组中计算机的名称。
wgname 指定要查看其计算机名的工作组的名称。
/YES 执行NET VIEW命令时,不会首先提示您提供信息或确认操作。

若要在工作组中显示共享资源的计算机列表,请键入没有选项的Net视图。

Syntax: Windows Vista, 7, 8, and 10

net[ accounts| computer| config| continue| file| group| help| helpmsg| localgroup
| pause| session| share| start| statistics| stop| time| use| user| view]
NET ACCOUNTS Adjust account settings.

[/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length]
[/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days]
[/UNIQUEPW:number] [/DOMAIN]

NET COMPUTER Add other networked computers with Windows Domain Controller.

\\computername {/ADD | /DEL}

NET CONFIG Displays your current server or workgroup settings.

[SERVER | WORKSTATION]

NET CONTINUE Continues the use of service.

[service]

NET FILE Display opened shared files on the server.

[id [/CLOSE]]

NET GROUP Add, delete, view, and otherwise manage network workgroups.

[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname username [...] {/ADD | /DELETE} [/DOMAIN]

NET LOCALGROUP Add, delete, view, and otherwise manage network groups.

[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]

NET NAME Create or delete name used for messaging.

[name [/ADD | /DELETE]]

NET PAUSE Pause the specified network service.

[service]

NET SESSION Display all sessions connected to the computer and deletes them if specified.

[\\computername] [/DELETE]

NET SHARE Create and manage a local network share.

sharename
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents| Programs | None ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents | Programs | None]
{sharename | devicename | drive:path} /DELETE

NET START Start the specified network service.

[service]

NET STATISTICS Display network statistics of the workstation or server.

[WORKSTATION | SERVER]

NET STOP Stop the specified network service.

service

NET TIME Display the time and date of another network computer.

[\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET]
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]

NET USE Connects or disconnects your computer from a shared resource or displays information about your connections.

[devicename | *] [\\computername\sharename[\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}]

NET USER Displays users on the computer or domain.

[username [password | *] [options]] [/DOMAIN]
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]

NET VIEW Displays a list of computers in a specified workgroup or the shared resources available on a specified computer.

[\\computername [/CACHE] | /DOMAIN[:domainname]]
NET VIEW /NETWORK:NW [\\computername]

Windows XP syntax

NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG 
| LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
NET ACCOUNTS Adjust account settings.

[/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length]
[/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days]
[/UNIQUEPW:number] [/DOMAIN]

NET COMPUTER Add other networked computers with Windows Domain Controller.

\\computername {/ADD | /DEL}

NET CONFIG Displays your current server or workgroup settings.

[SERVER | WORKSTATION]

NET CONTINUE Continues the use of service.

[service]

NET FILE Display opened shared files on the server.

[id [/CLOSE]]

NET GROUP Add, delete, view, and otherwise manage network workgroups.

[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname username [...] {/ADD | /DELETE} [/DOMAIN]

NET LOCALGROUP Add, delete, view, and otherwise manage network groups.

[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]

NET NAME Create or delete name used for messaging.

[name [/ADD | /DELETE]]

NET PAUSE Pause the specified network service.

[service]

NET PRINT Manage network print jobs.

\\computername\sharename
[\\computername] job# [/HOLD | /RELEASE | /DELETE]

NET SEND Sends messages to other users, computers, or messaging names on the network. The messenger service must be running to receive messages.

You can send a message only to a name that is active on the network. If the message is sent to a username, that user must be logged on and running the Messenger service to receive the message.

{name | * | /DOMAIN[:name] | /USERS} message

NET SESSION Display all sessions connected to the computer and deletes them if specified.

[\\computername] [/DELETE]

NET SHARE Create and manage a local network share.

sharename
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents| Programs | None ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents | Programs | None]
{sharename | devicename | drive:path} /DELETE

NET START Start the specified network service.

[service]

NET STATISTICS Display network statistics of the workstation or server.

[WORKSTATION | SERVER]

NET STOP Stop the specified network service.

service

NET TIME Display the time and date of another network computer.

[\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET]
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]

NET USE Connects or disconnects your computer from a shared resource or displays information about your connections.

[devicename | *] [\\computername\sharename[\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}]

NET USER Displays the users on the computer or domain.

[username [password | *] [options]] [/DOMAIN]
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]

NET VIEW Displays a list of computers in a specified workgroup or the shared resources available on a specified computer.

[\\computername [/CACHE] | /DOMAIN[:domainname]]
NET VIEW /NETWORK:NW [\\computername]

Windows 2000 syntax

NET [ CONFIG | DIAG | HELP | INIT | LOGOFF | LOGON | PASSWORD | PRINT | SEND | SHARE | START 
| STOP | TIME | USE | VER | VIEW ]
NET CONFIG Displays your current workgroup settings.

NET CONFIG [/YES]

/YES Carries out the NET CONFIG command without
first prompting you to provide information or
confirm actions.
NET DIAG Runs the Microsoft Network Diagnostics program to test the hardware connection between two computers and to display information about a single computer.
NET DIAGNOSTICS [/NAMES | /STATUS]
/NAMES Specifies a diagnostic server name to avoid conflicts when NET DIAG is used simultaneously by multiple users. This option works only when the network uses a NetBIOS protocol.
/STATUS Enables you to specify a computer that you want network diagnostics information.
NET HELP Displays information about NET commands and error messages.

command /?
NET HELP [suffix]
NET HELP errornum

command /? Specifies the Microsoft NET command that you want information about.
suffix Specifies the second word of the command you want information about. For example, the suffix of NET VIEW is VIEW.
errornum Specifies the number of the error message that you want information about.
NET INIT Loads protocol and network adapter drivers without binding them to Protocol Manager. This command may be required if you are using a third-party network adapter driver. You can then bind the drivers to Protocol Manager by typing NET START NETBIND.

NET INITIALIZE [/DYNAMIC]

/DYNAMIC Loads the Protocol Manager dynamically that is useful with some third-party networks, such as Banyan VINES, to resolve memory problems.
NET LOGOFF Breaks the connection between your computer and the shared resources to which it connects.

NET LOGOFF [/YES]

/YES Carries out the NET LOGOFF command without first prompting you to provide information or confirm actions.
NET LOGON Identifies you as a member of a workgroup.

NET LOGON [user [password | ?]] [/DOMAIN:name] [/YES] [/SAVEPW:NO]

user Specifies the name that identifies you in your workgroup. The name you specify can contain up to 20 characters.
password The unique string of characters that authorizes you to gain access to your password-list file. The password can contain up to 14 characters.
? Specifies that you want to be prompted for your password.
/DOMAIN Specifies that you want to log on to a Microsoft Windows NT or LAN Manager domain. The name specifies the Windows NT or LAN Manager domain you want to log on to.
/YES Carries out the NET LOGON command without first prompting you to provide information or confirm actions.
/SAVEPW:NO Carries out the NET LOGON command without prompting you to create a password-list file.

If you would rather be prompted to type your username and password instead of specifying them in the NET LOGON command line, type NET LOGON without options.

NET PASSWORD Changes your logon password.

NET PASSWORD [oldpassword [newpassword]]
NET PASSWORD \\computer | /DOMAIN:name [user [oldpassword [newpassword]]]

oldpassword Specifies your current password.
newpassword Specifies a new password. It can have as many as 14 characters.
computer Specifies the Windows NT or LAN Manager server on which you want to change your password.
/DOMAIN Specifies that you want to change your
password on a Windows NT or LAN Manager domain.
Name specifies the Windows NT or LAN Manager domain on which you want to change your password.
user Specifies your Windows NT or LAN Manager username.

The first syntax line above is for changing the password for your password-list file. The second syntax line above is for changing your password on a Windows NT or LAN Manager server or domain.

NET PRINT Displays information about print queues and controls print jobs.

NET PRINT \\computer[\printer] | port [/YES]
NET PRINT \\computer | port [job# [/PAUSE | /RESUME | /DELETE]] [/YES]

computer Specifies the name of the computer whose print queue you want information about.
printer Specifies the name of the printer you want information about.
port Specifies the name of the parallel port (LPT) on your computer connected to the printer you want information about.
job# Specifies the number assigned to a queued print job. You can specify the options below.
/PAUSE Pauses a print job.
/RESUME Restarts a print job that was paused.
/DELETE Cancels a print job.
/YES Carries out the NET PRINT command without first prompting you to provide information or confirm actions.

When specifying the computer name using NET PRINT, you receive information about the print queues on each of the shared printers that are connected to the computer.

NET SEND NET SEND {name | * | /DOMAIN[:name] | /USERS} message

Sends messages to other users, computers, or messaging names on the network. The Messenger service must be running to receive messages.

You can send a message only to a name that is active on the network. If the message is sent to a username, that user must be logged on and running the Messenger service to receive the message.

name Is the username, computer name, or messaging name to send the message. If the name is a computer name that contains blank characters, enclose the alias in quotation marks (" ").
* Sends the message to all the names in your group.
/DOMAIN[:name] Sends the message to all the names in the workstation domain. If name is specified, the message is sent to all the names in the specified domain or workgroup.
/USERS Sends the message to all users connected to the server.
message The text to be sent as a message.
NET SHARE NET SHARE sharename
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Automatic | No ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Automatic | No ]
{sharename | devicename | drive:path} /DELETE
NET START Starts services. NOTE: Services cannot be started from a command prompt within Windows.

NET START [BASIC | NWREDIR | WORKSTATION | NETBIND | NETBEUI | NWLINK] [/LIST] [/YES] [/VERBOSE]

BASIC Starts the basic redirector.
NWREDIR Starts the Microsoft Novell compatible redirector.
WORKSTATION Starts the default redirector.
NETBIND Binds protocols and network adapter drivers.
NETBEUI Starts the NetBIOS interface.
NWLINK Starts the IPX/SPX-compatible interface.
/LIST Displays a list of the services that are running.
/YES Carries out the NET START command without first prompting you to provide information or confirm actions.
/VERBOSE Displays information about device drivers and services as they are loaded.

To start the workgroup redirector you selected during setup, type NET START without options. In general, you don't need to use any of the options.

NET STOP Stops services. NOTE: Services cannot be stopped from a command prompt within Windows.
NET STOP [BASIC | NWREDIR | WORKSTATION | NETBEUI | NWLINK] [/YES]
NET STOP Stops the basic redirector.
BASIC Stops the basic redirector.
NWREDIR Stops the Microsoft Novell compatible redirector.
WORKSTATION Stops the default redirector.
NETBEUI Stops the NetBIOS interface.
NWLINK Stops the IPX/SPX compatible interface.
/YES Carries out the NET STOP command without first prompting you to provide information or confirm actions.

To stop the workgroup redirector, type NET STOP without options. This command breaks all your connections to shared resources and removes the NET commands from your computer's memory.

NET TIME Displays the time on or synchronizes your computer's clock with the shared clock on a Microsoft Windows for Workgroups, Windows NT, Windows 95, or NetWare time server.

NET TIME [\\computer | /WORKGROUP:wgname] [/SET] [/YES]

computer Specifies the name of the computer (time server) whose time you want to check or use to synchronize your computer's clock.
/WORKGROUP Specifies that you want to use the clock on a computer (time server) in another workgroup.
wgname Specifies the name of the workgroup containing a computer whose clock you want to check or use to synchronize your computer's clock. If there are multiple time servers in that workgroup, NET TIME uses the first one it finds.
/SET Synchronizes your computer's clock with the clock on the computer or workgroup you specify.
/YES Carries out the NET TIME command without first prompting you to provide information or confirm actions.
NET USE Connects or disconnects your computer from a shared resource or displays information about your connections.

NET USE [drive: | *] [\\computer\directory [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]
NET USE [port:] [\\computer\printer [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]

NET USE drive: | \\computer\directory /DELETE [/YES]
NET USE port: | \\computer\printer /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 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 don't 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 re-type 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.
/HOME Makes a connection to your HOME directory if one is specified in your LAN Manager or Windows NT user account.

To list all your connections, type NET USE without options.

NET VER Displays the type and version number of the workgroup redirector you are using.

NET VER

NET VIEW Displays a list of computers in a specified workgroup or the shared resources available on a specified computer.

NET VIEW [\\computer] [/YES]
NET VIEW [/WORKGROUP:wgname] [/YES]

computer Specifies the name of the computer whose shared resources you want to see listed.
/WORKGROUP Specifies that you want to view the names of the computers in another workgroup that share resources.
wgname Specifies the name of the workgroup whose computer names you want to view.
/YES Carries out the NET VIEW command without first prompting you to provide information or confirm actions.

To display a list of computers in your workgroup that share
resources, type NET VIEW without options.

查看英文版

查看中文版

net 示例

net use z: \\computer\folder

将Z:驱动器映射到网络路径//Computer/文件夹。

net send mrhope "There is hope!"

向主机名为mrhope的计算机发送文本消息“hope There hope!”


此命令仅在支持它的Windows版本中有效。


新版本的Windows不再支持NET SEND命令。相反,请使用msg命令。

net send * "Hello everyone!"

上面的命令将发送“大家好!”发送给当前域中的所有用户。

谨慎使用此命令。在学校或公司网络上,任何启用了Messenger服务的计算机都可以接收消息。

net config workstation

显示有关网络的其他信息,如计算机名称、工作组、登录域、DNS和其他有用信息。

net view \\hope

要查看可用的计算机及其共享资源,您可以使用下面的任一命令。第一个示例显示可用的计算机。最后一个命令将显示HOPE计算机上的共享资源。

net localgroup

显示计算机上当前设置的所有组。

net share

显示计算机上的所有网络共享。

net share hope=c:\hope\files

为“c:\ope\files”目录创建一个名为“Hope”的共享。

net use z: \\computer\folder

Map the Z: drive to the network path //computer/folder.

net send mrhope "There is hope!"

Send a text message to the computer with a hostname of mrhope the message There is hope!.

Note
This command only works in Windows versions that support it.

Note

New versions of Windows no longer support the net send command. Instead, use the msg command.

net send * "Hello everyone!"

The command above would send "Hello everyone!" to all users in your current domain.

Note

Used this command with caution. On a school or corporate network, any computer with the Messenger service enabled could receive the message.

net config workstation

Display additional information about the network such as the computer's name, workgroup, logon domain, DNS, and other useful information.

net view \\hope

To view the available computers and their shared resources, you may use either of the commands below. The first example displays available computers. The last command would display the shared resources on the hope computer.

net localgroup

Display all groups currently setup on the computer.

net share

Display all network shares on your computer.

net share hope=c:\hope\files

Create a share called "hope" for the "c:\hope\files" directory.

今天的计算机禁用了信使服务。如果禁用此服务,则无法发送或接收网络发送的消息。如果需要使用此服务,请按照此页上的说明进行操作,然后选择启用该服务而不是禁用它。

Today's computers disable the messenger service. If this service is disabled, you cannot send or receive net send messages. If you need to use this service, follow the instructions on this page and choose to enable the service instead of disabling it.

查看英文版

查看中文版