SoFunction
Updated on 2025-03-09

Summary of commonly used related network commands under DOS

In environments such as Microsoft Network Client under DOS and Windows 9x DOS windows, there are many useful network commands that are not included in the commands that come with DOS. So, what are the commands like this? The following are the commonly used commands in them.
Arp
Display and modify the IP or token ring physical address translation table to Ethernet used by the "Address Resolution Protocol" (ARP). This command is only available after the TCP/IP protocol is installed.
arp -a [inet_addr] [-N [if_addr]]
arp -d inet_addr [if_addr]
arp -s inet_addr ether_addr [if_addr]
parameter
-a
Show the current ARP item by asking TCP/IP. If inet_addr is specified, only the IP and physical address of the specified computer are displayed.
-g
Same as -a.
inet_addr
Specify the IP address with the dotted decimal mark.
-N
Displays the network interface ARP item specified by if_addr.
if_addr
Specify the IP address (if any) that needs to be modified for its address translation table interface. If not, the first applicable interface will be used.
-d
Delete the item specified by inet_addr.
-s
Add an item in the ARP cache and associate the IP address inet_addr and the physical address ether_addr. The physical address is given by 6 hexadecimal bytes separated by hyphen. Specify the IP address using a dotted decimal mark. The item is permanent, that is, the item is automatically deleted from the cache after the timeout expires.
ether_addr
Specify the physical address.
Finger
Display information about users on a specified system running the Finger service. Different variables are output according to the remote system. This command is only available after the TCP/IP protocol is installed.
finger [-l] [user]@computer[...]
parameter
-l
Display information in long list format.
user
Specify the user to obtain relevant information. Omit user parameters to display information about all users on the specified computer:
@computer
Ftp
Transfer files to remote computers running the FTP service or from remote computers running the FTP service (sometimes called daemon). Ftp can be used interactively. Click the ftp command in the Related Topics list to get the available ftp subcommand description. This command is only available after the TCP/IP protocol is installed. Ftp is a service that once started, a sub-environment in which the ftp command can be used is created. By typing the quit sub-command, you can return from the sub-environment to the Windows 2000 command prompt.
When the ftp sub-environment is running, it is represented by the ftp command prompt.
ftp [-v] [-n] [-i] [-d] [-g] [-s:filename] [-a] [-w:windowsize] [computer]
parameter
-v
Disable remote server responses.
-n
Automatic login to the initial connection is prohibited.
-i
Close the interactive prompt when multiple files are transferred.
-d
Enable debugging and display all ftp commands passed between the client and the server.
-g
Disable filename groups, which allows the use of wildcard characters (*  and ?) in local file and pathnames. (See the glob command in the online "Command Reference".)
-s: filename
Specifies a text file containing the ftp command; these commands will run automatically when ftp is started. No spaces are allowed in this parameter. Use this switch instead of redirecting (> ).
-a
Use any local interface when bundling data connections.
-w:windowsize
Instead of the transfer buffer with the default size of 4096.
computer
Specify the computer name or IP address to which you want to connect to the remote computer. If specified, the computer must be the last parameter of the row.
Nbtstat
This diagnostic command uses NBT (NetBIOS on TCP/IP) to display protocol statistics and current TCP/IP connections. This command is only available after the TCP/IP protocol is installed.
nbtstat [-a remotename] [-A IP address] [-c] [-n] [-R] [-r] [-S] [-s] [interval]
parameter
-a remotename
List its name table using the name of the remote computer.
-A IP address
Use the IP address of the remote computer and list the name table.
-c
Given the IP address of each name and list the contents of the NetBIOS name cache.
-n
List the local NetBIOS name. "Registered" indicates that the name has been registered by Bnode or WINS (other node types).
-R
After clearing all names in the NetBIOS name cache, reload the Lmhosts file.
-r
Lists the name resolution statistics for Windows network name resolution. On Windows 2000 computers that are configured to use WINS, this option returns the number of names to be parsed and registered via broadcast or WINS.
-S
Displays client and server sessions and lists remote computers only by IP address.
-s
Displays client and server sessions. Try to convert the remote computer IP address to the name of the host file.
interval
Redisplay the selected statistics and pause interval between each display. Press CTRL+C to stop redisplaying statistics. If this parameter is omitted, nbtstat prints the current configuration information once.
Netstat
Displays protocol statistics and current TCP/IP network connections. This command can only be used after the TCP/IP protocol is installed.
netstat [-a] [-e] [-n] [-s] [-p protocol] [-r] [interval]
parameter
-a
Shows all connections and listening ports. Server connections are not usually displayed.
-e
Display Ethernet statistics. This parameter can be used in conjunction with the -s option.
-n
Displays the address and port number in numeric format (rather than trying to find the name).
-s
Shows statistics for each protocol. By default, statistics for TCP, UDP, ICMP, and IP are displayed. The -p option can be used to specify the default subset.
-p protocol
Displays the connection to the protocol specified by protocol; protocol can be tcp or udp. If used with the -s option to display statistics for each protocol, protocol can be tcp, udp, icmp or ip.
-r
Displays the contents of the routing table.
interval
Redisplay the selected statistics and pause interval between each display. Press CTRL+B to stop redisplaying statistics. If this parameter is omitted, netstat will print the current configuration information once.
Ping
Verify the connection to the remote computer. This command can only be used after the TCP/IP protocol is installed.
ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [[-j computer-list] | [-k computer-list]] [-w timeout] destination-list
parameter
-t
Ping The specified computer is until interrupted.
-a
Resolve the address to the computer name.
-n count
Send count, the specified number of ECHO packets. The default value is 4.
-l length
Send ECHO data packets containing the amount of data specified by length. The default is 32 bytes; the maximum value is 65,527.
-f
Send the "Don't segment" flag in the packet. The packets will not be segmented by the gateway on the route.
-i ttl
Set the "Survival Time" field to the value specified by ttl.
-v tos
Set the "Service Type" field to the value specified by tos.
-r count
Record the routes for outgoing and returning packets in the Record Routing field. count can specify at least 1 computer and up to 1 computer.
Specify the remote computer to ping.
Rcp
Copy files between a Windows 2000 computer and a system running the remote shell port monitoring program rshd. The rcp command is a connection command. When issuing this command from a Windows 2000 computer, it can also be used for other transmissions to copy files between two computers running rshd. The rshd port monitoring program can be used on UNIX computers, but cannot be used on Windows 2000, so the Windows 2000 computer can only participate as a system that issues commands. The remote computer must also provide the rcp utility by running rshd.
rcp [-a | -b] [-h] [-r] source1 source2 ... sourceN destination
parameter
-a
Specify the ASCII transmission mode. This mode converts carriage return/line newline characters to carriage return characters on outgoing files and line newline characters to carriage return/line newline characters in incoming files. This mode is the default transmission mode.
-b
Specifies the binary image transfer mode. No carriage return/line newline conversion was performed.
-h
Transfer the source file marked as hidden attributes on Windows 2000 computer. If this option is not available, the effect of specifying a hidden file on the rcp command line does not exist the same as the file.
-r
Recursively copy all subdirectories of the source to the destination. Both source and destination must be directories, although even if the source is not a directory, use -r can work. But there will be no recursion.
source and destination
The format must be [computer[.user]:]filename. If the [computer[.user]:] part is ignored, the computer will be assumed to be the local computer. If the [.user] section is omitted, the currently logged in Windows 2000 username will be used. If a fully qualified computer name is used, which contains the period (.) delimiter, it must contain [.user]. Otherwise, the last part of the computer name will be interpreted as the user name. If multiple source files are specified, destination must be a directory.
If the file name is not headed by a UNIX forward slash (/) or a Windows 2000 system backslash (\) then it is assumed to be relative to the current working directory. In Windows 2000, this is the directory where the command is issued. In a remote system, this is the login directory for the remote user. Period (.) represents the current directory. Use escape characters (\, ", or ') in a remote path to use wildcards in a remote computer.
Rexec
Run commands on a remote computer running the REXEC service. The rexec command verifies the user name on the remote computer before executing the specified command. This command can only be used after the TCP/IP protocol is installed.
rexec computer [-l username] [-n] command
parameter
computer 
Specify the remote computer to run command.
-l username 
Specify the username on the remote computer.
-r
Redirect the input of rexec to NULL.
command 
Specifies the command to run.
Route
Controls the network routing table. This command can only be used after the TCP/IP protocol is installed.
route [-f] [-p] [command [destination] [mask subnetmask] [gateway] [metric costmetric]]
parameter
-f
Clear the routing table for all gateway portals. If this parameter is used in combination with a command, the routing table is cleared before running the command.
-p
When used with the add command, this parameter will cause the route to persist between the system bootloaders. By default, routes are not retained when the system restarts. When used with the print command, a registered persistent route list is displayed. Ignore all other commands that always affect the corresponding persistent route.
command
Specify one of the following commands.
Order Purpose
print Print route
add Add route
delete delete route
change Change existing route
destination
Specify the computer to send command.
mask subnetmask
Specifies the subnet mask associated with the routing entry. If not specified, 255.255.255.255 will be used.
gateway 
Specify the gateway.
The network database file named Networks and the computer name database file named Hosts refer to all symbolic names used by destination or gateway. If the command is print or delete, the target and gateway can also use wildcard characters, or the gateway parameters can be omitted.
metric costmetric
Assign integer hops (from 1 to 9999) to be used when calculating the fastest, most reliable and/or cheapest routes.
Rsh
Run commands on a remote computer running the RSH service. This command can only be used after the TCP/IP protocol is installed.
rsh computer [-l username] [-n] command
parameter
computer
Specify the remote computer running command.
-l username
Specifies the username to use on the remote computer. If omitted, the logged-in username is used.
-n
Redirect the input of rsh to NULL.
command
Specifies the command to run.
Tftp
Transfer files to a remote computer running the TFTP service or transfer files from a remote computer running the TFTP service. This command can only be used after the TCP/IP protocol is installed.
tftp [-i] computer [get | put] source [destination]
parameter
-i
Specifies the binary image transfer mode (also known as "octets"). In binary image mode, the file moves verbatim byte after byte. Use this mode when transferring binary files.
If -i is omitted, the file will be transferred in ASCII mode. This is the default transmission mode. This mode converts the EOL character to UNIX carriage return and personal computer carriage return/line newline character. This mode should be used when transferring text files. If the file is transferred successfully, the data transfer rate will be displayed.
computer
Specify a local or remote computer.
put
Transfer the file destination on the local computer to the file source on the remote computer.
get
Transfer the destination file on the remote computer to the source file on the local computer.
If you transfer the file file-two on the local computer to the file-one on the remote computer, please specify put. If you transfer the file file-two on the remote computer to the file-one on the remote computer, please specify get.
Because the tftp protocol does not support user authentication, the user must be logged in and the file must be writeable on the remote computer.
source
Specifies the file to be transferred. If the local file is specified as -, the remote file is printed out on stdout (if fetched), or read from stdin (if put).
destination
Specifies the location to which the file is transferred. If destination is omitted, it will be assumed that the same name as source is.
Tracert
The diagnostic utility sends an echo packet of Internet Control Message Protocol (ICMP) with different survival time (TTL) values ​​to the target to determine the route to reach the target. To decrement at least 1 before forwarding the TTL on the packet, each router on the required path is required, so TTL is a valid hop count. When the TTL on the packet reaches 0, the router should send the message "ICMP timed out" back to the source system. Tracert first sends an echo packet with TTL of 1, and increments TTL by 1 in each subsequent sending process until the target response or TTL reaches its maximum value, thereby determining the route. The route determines the route by checking the message "ICMP timed out" sent back by the intermediate router. However, some routers quietly upload data packets containing expired TTL values, but tracert cannot see them.
tracert [-d] [-h maximum_hops] [-j computer-list] [-w timeout] target_name
parameter
/d
Specifies that the address is not resolved to a computer name.
-h maximum_hops
Specifies the maximum number of hops for the search target.
-j computer-list
Specifies the sparse source route along computer-list.
-w timeout
Wait timeout for each response. The specified number of microseconds.
target_name
The name of the target computer.
In addition, there are IPCONFIG, DNR and other commands, which will not be introduced one by one here.