In the life of an experienced system administrator, there are always a couple of useful cmd commands in stock that help him perform various kinds of routine operations. It would seem that it is high time to abandon the command line, given the constant work of the Microsoft and Apple development companies on their Windows and Mac OS X operating systems, respectively. But sometimes you still have to resort to cmd commands, which allow you to perform very specific and rare operating system settings. There may be several reasons for this. This is the speed of the command line compared to the graphical interface and the convenience of the command line in some situations.
Now I will look at the work of the 15 most useful and popular cmd commands for the system administrator and more. They will be useful to anyone who sometimes configures network communications or solves Windows network problems.
arp - change IP address translation tables
arp command displays and modifies the IP-to-physical address translation tables used by the Address Resolution Protocol (ARP).
Each network device in Ethernet networks, be it a network card or a router, has a so-called MAC address (Media Access Control), which is divided into two parts: the first part is determined by the manufacturer, and the second is the unique device number. This MAC address is needed in order to uniquely identify all devices on the network, no matter what network topology they are in. In a nutshell, each network device stores in its records a table of MAC addresses with which it “communicated” with network packets.
arp -a - the command displays the current ARP table for all interfaces present on the computer. This way you can see whether a specific device responded. If the required entry is not present, then the devices were unable to exchange packets.
arp -d - the command allows you to clear the entire ARP table.
arp
The full syntax for the arp command can be found at the Windows Command Prompt.
Use the Start Menu
You can also quickly access Settings from the Start menu. First, click the Windows icon in the lower left corner of your desktop.
The Start menu will open. Click the gear icon at the bottom of the menu.
The Settings application will open.
driverquery - view installed device drivers
A very useful utility that can display a list of installed device drivers. You can also get the path to the folder where the driver is installed by typing the command with the /V . driverquery utility will help you easily find where the problematic driver is located.
driverquery
The full syntax of the utility can be found by typing driverquery /? .
Use the Help Center
There is also a way to launch the Settings app from the Event Center. First, click the text pop-up in the bottom right corner of your desktop to open Action Center.
Then click Expand in the lower left corner of the Action Center.
The list of options will expand. Click All Settings.
Settings will open.
gpupdate - updating group policy settings
An indispensable command for Windows domain network system administrators. It will help you apply Active Directory settings immediately if needed. To do this, just type the command with the /Force . This will help update the computer and user group policies. If you type the command without keys, only the changed policies will be updated.
gpupdate
ipconfig - IP protocol configuration for Windows
ipconfig command line utility will show the current settings of the TCP/IP protocol and will allow you to update some of the parameters specified when automatically configuring network interfaces when using the Dynamic Host Configuration Protocol (DHCP).
So, ipconfig will help you manually request an IP address from the DHCP server if for some reason your Windows computer does not receive it. To request an IP address, you need to type ipconfig /release and then ipconfig /renew .
The ipconfig /all command will allow you to obtain information about the IP protocol settings, including the DNS servers used in the system.
Additionally, the ipconfig /flushdns will update the DNS addresses.
ipconfig
These commands are very important and useful for Windows network administrators to troubleshoot network problems.
Ipconfig can also work with IP version 6.
Windows backup
You can create a restore point from the command line in Windows 10 itself; to do this, we need to launch the console using hotkeys, follow the instructions:
- [Win] + [X] → “Command Line (Administrator)” → OK
Now we will create a directory for a copy of Windows, enter:
- “mkdir С:Imagen-Restaurar” and press [enter]
Nothing will happen after entering - the console will return a response only as a result of completion. Therefore, for 20 to 30 years, avoid any manipulation with the computer.
I would like to note that in order to avoid mistakes, do not put spaces between words, replace “-”; Do not under any circumstances change the names of directories to avoid failure.
Here, “C:” - there will be a copy - choose the recording path yourself, be it an external screw, or another local disk. And “Imagen-Restaurar” is the name of the folder. After the successful completion message appears, make sure “CustomRefresh.wim” is in place; if it is not there, restart and try again.
nbtstat - protocol statistics and current TCP/IP connections using NBT
NBT (Network BIOS over TCT/IP) or NETBIOS protocol is one of the oldest protocols, developed back in 1983 by order of IBM. NETBIOS is designed to transfer data within one logical network segment.
nbtstat -n - displays a list of registered NetBIOS names on the computer. A list is displayed for all active network connections.
nbtstat -RR - will clear and re-register NetBIOS names on the local computer.
nbtstat
net - computer network configuration management
net is a whole set of commands that display the result of connecting/disconnecting a computer to a shared resource and display information about computer connections. To work with the utility, you will need Windows administrator rights. Let's look at the most significant net .
NET ACCOUNTS - Used to manage user account information and change login settings for all accounts.
NET COMPUTER - adds/removes computers to a domain database managed by Active Directory. This command can only be used on domain controllers. NET COMPUTER \\win7v /add — add a computer named win7v to this domain.
NET CONFIG - Displays information about configuring workstation or server services. NET CONFIG SERVER - display the current settings for the server service settings.
NET FILE - displays a list of files open over the network and can force close a shared file and remove file locks.
NET GROUP and NET LOCALGROUP - the commands are almost identical, but the first is executed on the domain controller and relates to Active Directory objects, and the second - to local workgroups on the computer. NET LOCALGROUP - display a list of groups for this computer.
NET HELPMSG - Displays information about Windows network messages. If you enter the NET HELPMSG and the error number, Windows displays an explanation for the message and suggests possible actions you can take to resolve the error. NET HELPMSG 51 - display details of message number 51
NET PAUSE and NET CONTINUE - are designed to control Windows services: putting them into standby mode or continuing to work.
NET SESSION - Terminates current communication sessions between this computer and other computers on the network or displays a list of them. When using a command without parameters, information about all current communication sessions with the computer of interest is displayed. This command is only used on servers.
NET SHARE - allows other network users to use server resources. When the command is used without parameters, information about all shared resources on the computer is displayed. For each resource, the device name or path and the corresponding comment are displayed. NET SHARE Admin$ - display information about the shared resource Admin$
NET STOP and NET START - used to stop and start Windows system services. NET STOP dnscache - stop the DNS client service.
NET TIME - Synchronizes a computer's clock with the clock of another computer or domain, or displays the time of a computer or domain. When used without parameters in a Windows Server domain, the command displays the current date and time set on the computer designated as the time server for that domain.
NET USE - Connects a computer to a shared resource or disconnects a computer from a shared resource. When the command is used without parameters, a list of connections for this computer is displayed. NET USE R: \\server\share — connect as a network drive R: network resource share on the server server.
NET USER - used to create and change user accounts on computers. When you run the command without parameters, a list of user accounts for this computer is displayed. NET USER user1 - display information about user user1. Example:
NET VIEW - Displays a list of shared resources on the computer. NET VIEW /ALL - Displays all shares, including $.
A more complete list of commands and their syntax can be obtained by calling the command with the /HELP . For example, NET USE /HELP .
netstat - information about the status of network connections
Entering the netstat -an will provide a list of currently open ports and their associated IP addresses. This command will also tell you what state the port is in.
The Listening connection state indicates that the status bar displays information about the network service that is listening for incoming connections using the appropriate protocol to the address and port displayed in the Local Address .
The ESTABLISHED state indicates an active connection. Status column for TCP connections can display the current stage of the TCP session, determined by the processing of flag values in the TCP header.
Possible states: CLOSE_WAIT - waiting for the connection to be closed. CLOSED - connection is closed. ESTABLISHED—connection established. LISTENING - connection is expected (port is listening) TIME_WAIT - response time exceeded.
netstat
nslookup - DNS management
By and large, the utility is an analogue of DNS client services in Windows and allows you to diagnose and fix problems with name resolution in the DNS system.
When nslookup without parameters, the utility goes into interactive mode, waiting for user input.
nslookup google.ru - allows you to determine whether the name google.ru on your DNS server.
nslookup -type=mx google.ru - the same as in the previous example, but indicating the type of the requested record -type=mx . nslookup utility request with a list of mail servers serving the google.ru domain.
Even more features of the nslookup can be obtained from the help of the command itself.
nslookup
Using the Power User Menu
The Power User Menu, also known as the WinX Menu, is essentially a context menu for the Start menu. Open it by right-clicking the Windows icon in the lower left corner of your desktop or using the Windows + X keyboard shortcut.
The advanced user menu will appear. Here, click on Settings.
Settings will open.
ping - poll a host by name or IP address
Sometimes, it is necessary to find out whether sent packets actually reach a specific network device. And here the ping .
ping yandex.ru - the command will send a series of test packets to the specified yandex.ru address. If the response comes, then we can say that the remote device is able to communicate with the computer. Otherwise, you will immediately find out that the packets do not reach the computer, which means that something is blocking the exchange of data between the device and the computer.
ping
You can send an infinite number of packets by specifying the -t . , you can interrupt sending packets using the key combination Ctrl + C. In addition, -w to set the maximum waiting time for each response in milliseconds.
-l 1000 - allows you to set the size of the data field in bytes for each request sent.
sc - Windows Service Control Manager
SC is used to configure, poll status, stop, start, remove, and add system services from the Windows command line. If you have the appropriate rights, the SC command can be used to control services on both the local and remote systems.
Here are a few commands as an example:
sc query - Queries the states of a service or lists the states of service types.
sc start myservice - starts a service named myservice.
sc create myservice - creates a service. Writes a service to the registry and service database.
sc query
Launch system recovery from the console
Via the command line, there are two ways to restore the Windows 10 system.
Important! If Windows crashed due to a virus attack, first go to “Safe_mode” (safe mode) and conduct a deep analysis with an antivirus.
- If safe_mode is available with the console, press [F8].
- Enter: “rstrui.exe” → “System_Restore” → item “Restore_an_earlier_computer_state”.
Remember that after recovery you can’t change anything, only after a full recovery you can choose another version that is available.
- Depending on where the copy of Windows was recorded, this media must be inserted into the computer and then step by step:
- Start" → Hold [Shift] and left click "Restart"
- write “bootrec.exe” → press [_enter_]
A built-in utility that corrects errors with a number of tools, one of which must be specified when starting recovery. Screenshot below.
In addition, on our website you can find:
sfc - check the integrity of Windows system files
To check Windows system files, you will need to launch a command prompt with administrator rights and enter the command sfc /scannow . If sfc detects any damaged or missing files, it will automatically replace them using cached copies saved by Windows. It may take the team half an hour or even more to check.
sfc
How to configure the command prompt window
To adjust the Windows 10 administrator command line with convenience for a specific user, use the given algorithm (select values that are convenient for you to work with):
- Run the command prompt program (cmd.exe).
- In the upper left corner of the window that opens (where the standard black icon is), click the mouse.
- Next, select the “Properties” link.
- Open the “Settings” tab (in earlier versions – “General”).
- Let's change the default buffer size (short-term memory). Pay attention to the “Storing commands” area. In the Buffer Size field, enter 999, and in the Number of Buffers field, enter 5.
- Check the boxes in the “Edit” area next to the lines “Mouse selection” and “Quick paste”.
- Follow the "Location" hyperlink.