Microsoft DOS net command

Microsoft Net Commands

Microsoft Net Commands

Quick links

About net
Availability
Syntax
Examples
Related Q&A documents

About net

The net command is used to update, fix, or view the network or network settings. Listed in the Syntax we have listed each of net commands. For additional information and examples, see our Syntax section.

Availability

The net.exe command is an external command that is available in the below Microsoft operating systems.

  • Windows 95
  • Windows 98
  • Windows NT
  • Windows ME
  • Windows 2000
  • Windows XP
  • Windows Vista
  • Windows 7

Syntax

Windows XP syntax
Windows 2000 syntax

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 ACCOUNTSAdjust account settings.

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

NET COMPUTERAdd other networked computers with Windows Domain Controller.

\\computername {/ADD | /DEL}

NET CONFIGDisplays your current server and/or workgroup settings.

[SERVER | WORKSTATION]

NET CONTINUEContinues the use of service.

[service]

NET FILEDisplay opened shared files on the server.

[id [/CLOSE]]

NET GROUPAdd, delete, view, and otherwise manage network workgroups.

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

NET LOCALGROUPAdd, delete, view, and otherwise manage network groups.

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

NET NAMECreate or delete name used for messaging.

[name [/ADD | /DELETE]]

NET PAUSEPause the specified network service.

[service]

NET PRINTManage network print jobs.

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

NET SENDSends 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 an 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 SESSIONDisplay all sessions connected to the computer and deletes them if specified.

[\\computername] [/DELETE]

NET SHARECreate 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 STARTStart the specified network service.

[service]

NET STATISTICSDisplay network statistics of the workstation or server.

[WORKSTATION | SERVER]

NET STOPStop the specified network service.

service

NET TIMEDisplay the time and date of another network computer.

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

NET USEConnects 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 USERDisplays users on the computer and/or domain.

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

NET VIEWDisplays 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 CONFIGDisplays your current workgroup settings.

NET CONFIG [/YES]

/YESCarries out the NET CONFIG command without
first prompting you to provide information or
confirm actions.
NET DIAGRuns 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]

/NAMESSpecifies a diagnostic server name in order to avoid conflicts when NET DIAG is used simultaneously by multiple users. This option works only when the network uses a  NetBIOS protocol.
/STATUSEnables you to specify a computer about which you want  network diagnostics information.
NET HELPDisplays 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.
suffixSpecifies the second word of the command you want  information about. For example, the suffix of  NET VIEW is VIEW.
errornumSpecifies the number of the error message that you want information about.
NET INITLoads 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. This is useful with some third-party networks, such as  Banyan(R) VINES(R), to resolve memory problems.
NET LOGOFFBreaks the connection between your computer and the shared resources to which it is connected.

NET LOGOFF [/YES]

/YESCarries out the NET LOGOFF command without first prompting you to provide information or confirm actions.
NET LOGONIdentifies you as a member of a workgroup.

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

userSpecifies the name that identifies you in your workgroup. The name you specify can  contain up to 20 characters.
passwordThe 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.
/DOMAINSpecifies that you want to log on to a  Microsoft Windows NT or LAN Manager domain. name Specifies the Windows NT or LAN Manager domain you want to log on to.
/YESCarries out the NET LOGON command without first prompting you to provide information or confirm actions.
/SAVEPW:NOCarries out the NET LOGON command without prompting you to create a password-list file.

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

NET PASSWORDChanges your logon password.

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


oldpasswordSpecifies your current password.
newpasswordSpecifies your new password. It can have as many as 14 characters.
computerSpecifies the Windows NT or LAN Manager server on which you want to change your password.
/DOMAINSpecifies 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.
userSpecifies your Windows NT or LAN Manager user name.

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 PRINTDisplays information about print queues and controls print jobs.

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

computerSpecifies the name of the computer whose print queue you want information about.
printerSpecifies the name of the printer you  want information about.
portSpecifies the name of the parallel (LPT) port on your computer that is connected to the printer you want information about.
job#Specifies the number assigned to a queued print job. You can specify the below options.
/PAUSEPauses a print job.
/RESUMERestarts a print job that has been paused.
/DELETECancels a print job.
/YESCarries out the NET PRINT command without first prompting you to provide information or confirm actions.

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

NET SENDNET 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 an 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, computername, or messaging name to send the message to. If the name is a computername 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.
/USERSSends the message to all users connected to the server.
messageIs text to be sent as a message.
NET SHARENET 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 STARTStarts services. NOTE: Services cannot be started from a command prompt within Windows.

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

BASICStarts the basic redirector.
NWREDIRStarts the Microsoft Novell(R) compatible redirector.
WORKSTATIONStarts the default redirector.
NETBINDBinds protocols and network-adapter drivers.
NETBEUIStarts the NetBIOS interface.
NWLINKStarts the IPX/SPX-compatible interface.
/LISTDisplays a list of the services that are running.
/YESCarries out the NET START command without first prompting you to provide information or confirm actions.
/VERBOSEDisplays 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 STOPStops services. NOTE: Services cannot be stopped from a command prompt within Windows.

NET STOP [BASIC | NWREDIR | WORKSTATION | NETBEUI | NWLINK] [/YES]

NET STOPStops the basic redirector.
BASICStops the basic redirector.
NWREDIRStops the Microsoft Novell(R) compatible redirector.
WORKSTATIONStops the default redirector.
NETBEUIStops the NetBIOS interface.
NWLINKStops the IPX/SPX compatible interface.
/YESCarries 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 breaks all your connections to shared resources and removes the NET commands from your computer's memory.

NET TIMEDisplays 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]

computerSpecifies the name of the computer (time server) whose time you want to check or synchronize your computer's clock with.
/WORKGROUPSpecifies that you want to use the clock on a  computer (time server) in another workgroup.
wgnameSpecifies the name of the workgroup containing a computer whose clock you want to check or synchronize your computer's clock with. If there are multiple time servers in that workgroup, NET TIME uses the first one it finds.
/SETSynchronizes your computer's clock with the clock on the computer or workgroup you specify.
/YESCarries out the NET TIME command without first prompting you to provide information or confirm actions.
NET USEConnects 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

driveSpecifies the drive letter you assign to a shared directory.
*Specifies the next available drive letter. If used with /DELETE, specifies to disconnect all of your connections.
portSpecifies the parallel (LPT) port name you assign to a shared printer.
computerSpecifies the name of the computer sharing the resource.
directorySpecifies the name of the shared directory.
printerSpecifies the name of the shared printer.
passwordSpecifies 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:NOSpecifies that the password you type should not be saved in your password-list file. You need to retype the password the next time you connect to this resource.
/YESCarries out the NET USE command without first prompting you to provide information or confirm actions.
/DELETEBreaks the specified connection to a shared
resource.
/NOCarries out the NET USE command, responding  with NO automatically when you are prompted to confirm actions.
/HOMEMakes a connection to your HOME directory if one is specified in your LAN Manager or Windows NT user account.

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

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

NET VER

NET VIEWDisplays 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]

computerSpecifies the name of the computer whose shared resources you want to see listed.
/WORKGROUPSpecifies that you want to view the names of the computers in another workgroup that share resources.
wgnameSpecifies the name of the workgroup whose computer names you want to view.
/YESCarries 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.

Examples

net use z: \\computer\folder

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

net send joeuser "Where are you?"

Send a text message to the computer with a host name of joeuser the message Where are you?. Note: This command only works for Windows versions that support this command.

Note: Many computers today have also disabled the messenger service, if this service is disabled you will be unable to send/receive net send messages.

net send * "Where are you?"

The above command would send Where are you? to all users in your current domain. This command should be used with caution since if you're on a school or work network many of the computers on that network if not all well be sent a message if the messenger service is enabled on the computers.

net config workstation

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

net view \\joeuser

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

net localgroup

Display all groups currently setup on the computer you're running the command on.

net share

Display all network shares on your computer.

net share myshare=c:\programs\files

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