MS-DOS and Windows command line 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.
Net syntax
Windows Vista, 7, 8, and 10 syntax
NET ACCOUNTS | Adjust account settings. |
[/FORCELOGOFF:
[/MAXPWAGE:
[/UNIQUEPW:number] [/DOMAIN]
\\computername
[SERVER | WORKSTATION]
[service]
[id [/CLOSE]]
[groupname [/COMMENT:»text»]] [/DOMAIN]
groupname [/DOMAIN]
groupname username [. ] [/DOMAIN]
[groupname [/COMMENT:»text»]] [/DOMAIN]
groupname [/DOMAIN]
groupname name [. ] [/DOMAIN]
[name [/ADD | /DELETE]]
[service]
[\\computername] [/DELETE]
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]
[service]
[WORKSTATION | SERVER]
service
[\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET]
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[[email protected] domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:
NET USE
NET USE [/PERSISTENT:
[username [password | *] [options]] [/DOMAIN]
username
username [/DELETE] [/DOMAIN]
[\\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: |
NET COMPUTER | Add other networked computers with Windows Domain Controller. \\computername |
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] |
NET LOCALGROUP | Add, delete, view, and otherwise manage network groups. [groupname [/COMMENT:»text»]] [/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 |
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. |
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 |
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] |
NET USE | Connects or disconnects your computer from a shared resource or displays information about your connections. [devicename | *] [\\computername\sharename[\volume] [password | *]] NET USE NET USE [/PERSISTENT: |
NET USER | Displays the users on the computer or domain. [username [password | *] [options]] [/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]] |
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 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 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]
| ||||||||||||||||||||||||||
NET LOGOFF | Breaks the connection between your computer and the shared resources to which it connects.
| ||||||||||||||||||||||||||
NET LOGON | Identifies you as a member of a workgroup. NET LOGON [user [password | ?]] [/DOMAIN:name] [/YES] [/SAVEPW:NO]
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]]
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]
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 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.
| ||||||||||||||||||||||||||
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 | ?]] NET USE drive: | \\computer\directory /DELETE [/YES] NET USE drive: | * /HOME
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]
To display a list of computers in your workgroup that share resources, type NET VIEW without options. |
Net examples
Map the Z: drive to the network path //computer/folder.
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.
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.
Display additional information about the network such as the computer’s name, workgroup, logon domain, DNS, and other useful information.
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.
Display all groups currently setup on the computer.
Display all network shares on your computer.
Create a share called «hope» for the «c:\hope\files» directory.