Net command
The net command is used to update or fix a network or view its settings.
Availability
Net is an external command that is available for the following Microsoft operating systems as net.exe.
- Windows 95
- Windows 98
- Windows NT
- Windows Me
- Windows 2000
- Windows XP
- Windows Vista
- Windows 7
- Windows 8
- Windows 10
- Windows 11
Net syntax
Windows Vista and later syntax
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. 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]
|
||||||||||||||||||||||||||
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]
|
||||||||||||||||||||||||||
NET HELP | Displays information about NET commands and error messages. command /? NET HELP [suffix] NET HELP errornum
|
||||||||||||||||||||||||||
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. Then bind the drivers to Protocol Manager by typing NET START NETBIND. NET INITIALIZE [/DYNAMIC]
|
||||||||||||||||||||||||||
NET LOGOFF | Breaks the connection between your computer and the shared resources to which it connects. NET LOGOFF [/YES]
|
||||||||||||||||||||||||||
NET LOGON | Identifies you as a member of a workgroup. NET LOGON [user [password | ?]] [/DOMAIN:name] [/YES] [/SAVEPW:NO]
|
||||||||||||||||||||||||||
NET PASSWORD | Changes your logon password. NET PASSWORD [oldpassword [newpassword]] NET PASSWORD \\computer | /DOMAIN:name [user [oldpassword [newpassword]]]
|
||||||||||||||||||||||||||
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]
|
||||||||||||||||||||||||||
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. 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.
|
||||||||||||||||||||||||||
NET SHARE | NET SHARE sharename
|
||||||||||||||||||||||||||
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]
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]
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]
|
||||||||||||||||||||||||||
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
|
||||||||||||||||||||||||||
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]
|
Net examples
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!.
This command only works in Windows versions that support it.
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.
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.
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.