Networking / Beginners

The Net Start command

This command lets you start a networking service or display a list of all the services that are currently running. The syntax is

net start [service]

In most cases, you'll use this command to start a service that you've previously stopped with the Net Stop command. In that case, you should first run the Net Start command without any parameters to find the name of the service that you want to stop. Make a note of the exact spelling of the service that you want to stop. Then, use the Net Stop command to stop the service. When you want to restart the service, use the Net Start command again - this time specifying the service to start.

For example, suppose that you need to stop your DNS server. Using Net Start, you discover that the name of the service is "DNS Server," so you use the following command to stop it:

C:\>net stop "DNS Server"

Then, you can later use this command to restart the service:

C:\>net start "DNS Server"

The Net Statistics command

This command lists the statistics log for the local Workstation or Server service. The syntax is

net statistics [{workstation | server}]

You can specify Workstation or Server to indicate for which service you'd like to view statistics.

If you use Net Statistics Workstation, the following information appears:

  • The computer name.
  • The date and time the statistics were last updated.
  • The number of bytes and server message blocks (SMB) received and transmitted.
  • The number of read and write operations that succeeded or failed.
  • The number of network errors.
  • The number of sessions that failed, disconnected, or were reconnected.
  • The number of connections to shared resources that succeeded or failed.

If you use Net Statistics Server, the following information is listed:

  • The computer name.
  • The date and time the statistics were last updated.
  • The number of sessions that have been started, disconnected automatically, and disconnected because of errors.
  • The number of kilobytes sent and received and the average response time.
  • The number of password and permission errors and violations.
  • The number of times the shared files, printers, and communication devices were used.
  • The number of times the size of the memory buffer was exceeded.

The Net Stop command

This command lets you stop a networking service. The syntax is

net stop service

To use this command, first run the Net Start command to determine the exact spelling of the service that you want to stop. If the service name includes spaces, enclose it in quotation marks.

You can restart the service later using the Net Start command. The following example stops the DNS Server service:

C:\>net stop "DNS Server"

The Net Time command

This command synchronizes the computer's clock with the clock on another computer. To access a clock on another computer in the same domain or workgroup, use this form:

net time \\ComputerName [/set]

To synchronize time with a domain, use this form:

net time /domain[:DomainName] [/set]

To use an RTS time server, use this syntax:

net time /rtsdomain[:DomainName] [/set]

To specify the computer to use for Network Time Protocol, use this syntax:

net time [\\ComputerName] [/querysntp]
    [/setsntp[:NTPServerList]]

For example, to set the computer's clock to match the Server01, use this command:

C:\>net time \\Server01 /set

The Net Use command

This command connects to or disconnects from a shared resource on another computer and maps the resource to a drive letter. Here's the complete syntax:

net use [{drive | *}]
	[{\\ComputerName\ShareName]
	[{Password | *}]]
	[/user:[DomainName\]UserName]
	[/savecred]
	[/smartcard]
	[{/delete | /persistent:{yes | no}}]

To set up a home directory, use this syntax:

net use [drive [/home[{password | *}]
     [/delete:{yes | no}]]

And to control whether connections should be persistent, use this:

net use [/persistent:{yes | no}]

Here's what the parameters do:

  • DeviceName: Specifies the drive letter. (Note that for a printer, you should specify a printer device such as LPT1: here instead of a drive letter.) If you specify an asterisk, Windows will determine what drive letter to use.
  • \\ComputerName\ShareName: The server and share name to connect to.
  • Password: The password needed to access the shared resource. If you use an asterisk, you're prompted for the password.
  • User: Specifies the username to use for the connection.
  • Savecred: Saves the credentials for reuse later if the user is prompted for a password.
  • Smartcard: Specifies that the connection should use a smart card for authorization.
  • Delete: Deletes the specified connection. If you specify an asterisk (*), all network connections are canceled.
  • Persistent: Specifies whether connections should be persistent.
  • Home: Connects to the home directory.

To display all current connections, type net use with no parameters. The following example shows how to create a persistent connection to a drive named Acct on a server named Server01, using drive K:

C:\>net use k: \\Server01\Acct /persistent: yes

The following example drops the connection:

C:\>net use k: /delete
[Previous] [Contents] [Next]