SoFunction
Updated on 2025-04-10

Do All in Cmd Shell Everything is completed on the command line page 5/6



Network configuration
There are many command line tools for the network that Windows comes with, such as the familiar ping, tracert, ipconfig, telnet, ftp, tftp, netstat, and the less familiar nbtstat, pathping, nslookup, finger, route, netsh...
These commands can be divided into three categories: network detection (such as ping), network connection (such as telnet) and network configuration (such as netsh). The first two are relatively simple, and this article only introduces two network configuration tools.

netsh
Using netsh in a remote shell first requires solving a problem of interaction. As mentioned earlier, many shells cannot redirect output and output again, so they cannot use command line tools such as ftp interactively in this environment. The solution is that generally interactive tools allow scripts (or answer files). For example, ftp -s:filename. The same is true for netsh: netsh-f filename.

The netsh command has many functions, and can configure IAS, DHCP, RAS, WINS, NAT servers, TCP/IP protocol, IPX protocol, routing, etc. We are not administrators, so there is generally no need to know so much. We just need to use netsh to understand the network configuration information of the target host.

1. TCP/IP configuration

echo interface ip >s
echo show config >>s
netsh -f s
del s

From this you can understand whether the host has multiple network cards and IPs, whether it is dynamically allocated IP (DHCP), and what is the intranet IP (if any).
This command is similar to ipconfig /all.

Note that the following command requires the target host to start the remoteaccess service. If it is disabled, first unblock by importing the registry, then
net start remoteaccess

2,ARP

echo interface ip >s
echo show ipnet >>s
netsh -f s
del s

This is a little more information than the arp -a command.

3. TCP/UDP connection

echo interface ip >s
echo show tcpconn >>s
echo show udpconn >>s
netsh -f s
del s

This set of commands is the same as netstat -an.

4. Network card information
If the netsh command has other commands to replace, what else is there to do with it? The following one cannot be found instead.

echo interface ip >s
echo show interface >>s
netsh -f s
del s

Other functions of netsh, such as modifying the IP, are generally not necessary to use (if you can't connect after changing the IP, you will "that the sky should not be called the earth and the earth will not work"), so you can skip them all.
Previous page123456Next pageRead the full text