Subtleties of working on the Windows command line. How to open the command line

The command line is a text-based interface for managing the operating system. In many situations, the command line allows you to perform actions on the system much faster than using the graphical interface. Moreover, in some cases the command line is simply not replaceable. For example, such popular utilities as Ping or Ipconfig are launched only on the command line. In this article we will talk about how to open the command line in Windows 7.

Method number 1. Open the command line through the Start menu.

You can use it to launch any program and the command line is no exception. Open the Start menu and go to All Programs - Accessories. In the list of programs that opens, find the “Command Line” program and click on it.

In addition, you can use the search bar, which is located in the Start menu. To do this, open the Start menu and enter “Command Prompt” in the search bar.

The operating system will then find the command line and display it in the search results.

Method number 2. Open the command line in Windows 7 using the “Run” menu.

The “Run” menu is another popular method in Windows 7. To use this method, you need to press the Windows + R key combination and enter the “CMD” command in the window that opens.

After entering this command by pressing the enter button, the Windows 7 command line will open in front of you.

Method number 3. Create a shortcut to open the command line.

If you need to use the command line regularly, then you can. To do this, right-click on the desktop and select “Create – Shortcut”. In the window that opens, enter the command “CMD” and click on the “Next” button.

After that, enter the name of the shortcut and click on the “Done” button again.

That's it, after these steps a shortcut to open the command line will appear on the desktop. Using this shortcut, you can open the command line just like all other programs.

If necessary, you can specify a key combination for the shortcut, which, when pressed, will open the program automatically. To do this, open the properties of the command line shortcut and place the cursor in the field opposite the “Shortcut” item.

After that, click on any button. For example, let’s click on the button with the letter “C”.

As a result, the shortcut will be assigned the key combination Ctrl+Alt+C. To save changes, close the shortcut properties window by simply clicking on the “Ok” button. Now, when you use the combination Ctrl+Alt+C, the Windows 7 command prompt will open automatically.

Often in the description of a solution to any problem in Windows 7, there is a mention of the command line. What is it? This is the name of the system shell that lacks a graphical interface. User interaction with it is carried out by entering queries (commands).

Functions

There are a huge number of functions for it. Using the command line, you can perform any standard PC setup, check the system status, and display the configuration. It can completely replace the graphical interface. And at the same time, its capabilities are wider than those available in the standard Windows shell.

But most users still care about the graphical interface. Therefore, you should resort to working with the terminal as a last resort, when there are no alternative solutions to problems. Now let's take a closer look at simple ways to launch it and useful commands.

Launch

You can come up with a large number of ways to launch the command line in Windows 7, since the system allows it. But there are three easy options for the average user: in the dialog box "Run", via menu "Start" and through the executable file.

Method 1: Run Dialog Box

Dialog window "Run" is a partial replacement for Windows Terminal. Some commands are similar for them. However, it can also be used to launch the command line.

The easiest way to launch this utility is by simultaneously pressing Win + R. But you can also find it in the menu "Start", chapter "Standard". Enter cmd and click on the button "OK", after which the desired program will start.

Note: the command line opened in this way has limited functionality, since it is only granted user access. Accordingly, some actions will not be available. To unlock them, you need to enable them as an administrator.

Method 2: Start Menu

Menu "Start" designed to quickly call various system elements. Launch it, go to "All programs", open the section there "Standard". It will contain a shortcut to activate the command line.

Attention: unlike the previous option, in this case it is possible to launch the terminal with administrator rights. To do this, right-click on the desired element and select the second item.

Method 3: Executable file

Both previous methods were associated with indirect options for opening the terminal. But it can also be launched directly, through an executable file. His name - cmd.exe, located on the system drive, along the path Windows/System32.

An alternative access option is to search in Explorer. You can also find the element "Command line" in Start, right-click on it, select "Properties", and then "File location".

For executable filecmd.exe, you can create a shortcut, for example, on the desktop. This will make starting the console much easier in the future. Right-click on the document, select "Send - Desktop...". In this case, you can automatically launch the command line with administrator rights. To do this, open the shortcut properties, go to the section "Compatibility" and check the box next to the appropriate item.

Teams

Request help will display everything teamsWindows 7, available for input at the moment. For most of them, parameters or values ​​can be set. We will consider those queries that may be useful to the average user.

PC shutdown timer

Team shutdown is responsible for turning off the computer. It has the following attributes:

  • -s - turns off the PC immediately after entering.
  • -s -t 50 - turns off the PC after a certain time (50 is the number of seconds, the number can be changed to any).
  • -a - cancel the shutdown timer.

The specified attributes are written with a space after the command. It looks like this: “request attribute”. For example, to turn off the PC after 3 minutes you need to enter the following:

shutdown -s -t 180

Displaying computer configuration

Computer configuration information can be obtained through systeminfo.
It will display the status of network connections, installed amount of RAM, applied updates and other information.

Disk check

Team chkdsk causes the state of the logical disk partitions. And using it with the following attributes will perform the check:


Checking system components

To call this function, use the request sfc. It allows you to check the condition of system components and restore them if damage is detected. This is a useful command that is often required when fixing executable file errors.

It starts with the following attributes:

  • /scannow - immediately starts the scanning procedure.
  • /scanonce - assigns a scan to reboot the PC.
  • /scanboot - scanning is always enabled when Windows boots.

This article will cover the basics Windows command line, namely:

  • Command line concept;
  • Shell Commands Reference;
  • Sequence of events when executing a command;
  • Creating command line scripts;
  • Controlling the display of text and commands;
  • Commands for studying system information;
  • Commands for using the registry;
  • System services management;
  • Reboot and shutdown systems from the command line;
  • Manage applications and processes from the command line.

Command Line Concept

Command line support is built into the Microsoft Windows operating system and is accessible through a command shell window. The Command Prompt is supported in all versions of Windows and is used to run built-in commands, utilities, and scripts. Despite the power and flexibility of the Command Prompt, some Windows administrators never use it. If you have enough graphical administration tools, you can only use them by clicking the user interface elements.

However, experienced Windows administrators, qualified technical support specialists and advanced users cannot do without the command line. Knowing how to properly use the command line—specifically, which command line tools to choose and how and when to use them so that they work effectively—can help you avoid many problems and ensure smooth execution of your operations. If you support multiple domains or networks, understanding time-saving ways to work with the command line is not only important but necessary to automate daily operations.

With each new version of Windows, the command line has been improved and its capabilities expanded. The command line has undergone significant changes, associated not only with increased productivity, but also with increased flexibility. Now you can use the Windows command line to solve problems that could not be solved in previous versions of Windows.

The Windows command shell environment is launched in different ways, in particular by specifying parameters when running Cmd.exe or using its own startup file stored in the directory %SystemRoot%\System32.

Additionally, the command line can be run in batch mode to execute a set of commands. In batch mode, the command line reads and executes commands one after another.

When working with the Windows command line, you need to understand where the commands you use come from. “Native” commands (built into the operating system) come in two types:

  • Domestic– exist inside the command shell, they do not have separate executable files;
  • External- implemented in separate executable files, which are usually stored in the %SystemRoot%\System32 directory.

Quick reference to shell commands (Cmd.exe)

  • assoc- displays or modifies mappings ( associations) file types;
  • break- sets breakpoints when debugging
  • call- calls a procedure or another script from a script;
  • cd (chdir) - shows the name of the current directory or changes the current directory;
  • cls- clears the command line window and screen buffer;
  • color- sets the text and background colors of the command shell window;
  • sorry- copies files or performs file concatenation;
  • date- shows or sets the current date;
  • del (erase) - deletes a specified file, group of files, or directory;
  • dir- shows a list of subdirectories and files in the current or specified directory;
  • echo- displays text in the command line window or sets whether commands should be displayed on the screen (on|off);
  • endlocal- marks the end of localization ( local scope) variables;
  • exit- exit the command line shell;
  • for- executes the given command for each file in the set;
  • ftype Lists or changes current file types in file extension mappings to programs;
  • goto- specifies that the command interpreter should go to the line with the given label in the batch script;
  • if- executes commands according to conditions;
  • md (mkdir)- creates a subdirectory in the current or specified directory;
  • move- moves a file or group of files from the current or specified source directory to the specified directory. Can also rename a directory;
  • path- shows or sets the command path used by the operating system when searching for executable files and scripts;
  • pause- stops the execution of the batch file and waits for keyboard input;
  • popd- makes current the directory whose name was saved by the PUSHD command;
  • prompt- specifies what text should be shown in the invitation line;
  • pushd- saves the name of the current directory and, if necessary, makes the specified directory current;
  • rd (rmdir)- deletes a directory or a directory along with its subdirectories;
  • rem- marks comments in a batch script or Config.nt;
  • ren (rename)- Renames a file or group of files;
  • set- shows current environment variables or sets temporary variables for the current command shell;
  • setlocal- marks the beginning of localization ( local scope) variables in batch scripts;
  • shift- shifts the position of replaced parameters in batch scripts;
  • start- launches a specified program or command in a separate window;
  • time- shows or sets the system time;
  • title- sets the title of the command shell window;
  • type- shows the contents of a text file;
  • verify- turns on the file verification mode after writing to disk;
  • vol- shows the label and serial number of the disk volume.

The syntax of any internal command ( and most external) can be obtained by entering the command name and /? at the command line, for example:

Command shell- a very powerful environment for working with commands and scripts. The command line allows you to run different types of commands: built-in commands, Windows utilities, and command-line versions of applications. Regardless of the type, every command you use must follow the same syntax rules. According to these rules, the command name is followed by required or optional arguments. Additionally, arguments can use input, output, or standard error redirection.

Sequence of events when executing a command

  • The command shell replaces any variables entered in the command text with their current values;
  • If a group or chain of several commands is entered, the line is split into individual commands, which in turn are split into the command name and arguments. Next, the commands are processed separately;
  • If a command name specifies a path, the shell looks for the command in that path. If there is no such command in the specified directory, the shell returns an error;
  • If the command name does not include a path, the shell first tries to resolve the command name internally. If an internal command with the same name is found, then an internal command has been called and can be executed immediately. If there is no internal command with the same name, the shell first looks for the command's executable file in the current directory, and then in the directories listed in the PATH environment variable. If the command file is not in any of these directories, the shell returns an error;
  • If the command is found, it is executed with the given arguments and, if necessary, input is read from the source specified in those arguments. Command output and errors are shown in the Command Prompt window or sent to a specified output and error sink.
  • As you can see, many factors affect command execution, including command paths, I/O redirection, and grouping or chaining of commands.

When working with a command shell, you probably started it by opening the Start menu ( Start) and selecting Programs ( Programs) or All Programs ( All programs), then Accessories ( Standard) and Command Prompt ( Command line). Other ways to start the command line are the Run dialog box ( Starting the program) or typing cmd in another, already open command shell window. These methods allow you to specify arguments when starting the command line: switches that control the operation of the command line, and parameters that initiate the execution of additional commands. For example, you can start a command shell in silent mode ( i.e. disable echo output) with the cmd /q command or to make the command shell execute the given command and exit - to do this, enter cmd /c, followed by the command text in quotes.

The following example starts a command shell, runs the ipconfig command, outputs the results to a file, and exits:

Cmd /c "ipconfig > c:\ipconfig.txt"

Creating Command Line Scripts

Command Line Scripts- text files with commands that you want to execute. These are the same commands that you typically enter in the Windows command shell. However, instead of typing commands every time you need them, you can create a script to do so and make your life easier.

Since scripts consist of standard text characters, they can be created and edited in any standard text editor, say Notepad ( notebook). When entering commands, be sure to start each command or group of commands that must be executed together on a new line. This will ensure they are executed correctly. When you've finished creating the command line script, save the script file with a .bat or .cmd extension. Both extensions work the same. For example, if you need to create a script to display the system name, Windows version, and IP configuration, include the following three commands in the SysInfo.bat or SysInfo.cmd file:

Hostname ver ipconfig -all

Controlling the display of text and commands

Team ECHO serves two purposes: to write text to output ( for example, to a command shell window or a text file) and to enable/disable command echo display. Typically, when you run script commands, the commands themselves and the output of those commands are displayed in a console window. This is called command echoing ( command echoing).

To use the ECHO command to display text, type echo followed by the text you want to display:

Echo The system host name Is: hostname

To control echoing of commands using ECHO, type echo off or echo on, for example:

Echo off echo The system host name is: hostname

To direct output to a file rather than to a shell window, use output redirection, for example:

Echo off echo The system host name is: > current.txt hostname » current.txt

Now let's see how command echoing is suppressed. Start a command shell, type echo off, then other commands. You will see that the command prompt is no longer displayed. Instead, only what is typed in the console window and the output of executed commands appears. In scripts, the ECHO OFF command disables command echoing and the command prompt. By adding the ECHO OFF command to your scripts, you prevent your shell window or file from becoming cluttered with command text if you are only interested in the output from those commands.

Studying system information

Often, when working with a user's computer or a remote server, there is a need to obtain basic information about the system, such as the name of the user registered in it, the current system time, or the location of a specific file. Commands that collect basic system information include:

  • NOW- displays the current system date and time in 24-hour format, for example Sal May 9 12:30:45 2003. Available only in Windows Server 2003 Resource Kit;
  • WHOAMI- reports the name of the user currently registered in the system, for example adatum\administrator;
  • WHERE- searches for files using a search pattern ( search pattern) and returns a list of matching results.

To use NOW or WHOAMI, simply type the command in the command shell window and press Enter. The most common syntax for WHERE looks like this:

Where /r base_directory_file_name

Here the /r parameter is specified for a recursive search starting from the specified directory (base_directory) and including all its subdirectories, and file_name is the full or partial name of the file being searched, which may include wildcards: the ? replaces one character, and the * sign replaces a group of characters, for example data???.txt or data*.*. The following example searches the C:\ directory and all its subdirectories for all text files whose names begin with data.

Where /r C:\data*.txt

You can also find files of all types whose names begin with data:

Where /r C:\data*.*

Sometimes you need to obtain information about the system configuration or the system environment. On mission-critical systems, this information can be saved or printed for reference. Listed below are commands that allow you to collect information about the system.

  • DRIVERQUERY- displays a list of all installed device drivers and their properties, including the module name, display name ( display name), driver type and build date ( driver link date). The all information display (/V) mode reports the status and state of the driver, startup mode, memory usage information, and file system path. The /V option also turns on detailed information about all unsigned drivers.
  • SYSTEMINFO- Provides detailed information about the system configuration, including information about the version, type and manufacturer of the operating system, processor, BIOS version, memory size, regional standards, time zone and network adapter configuration.
  • NLSINFO- displays detailed regional information, including default language ( default language), Windows code page, time and number display formats, time zone, and installed code pages. This command is only available in the Windows Server 2003 Resource Kit.

To use these commands on your local computer, simply type the name of the desired command in the command shell window and press Enter.

Commands for using the registry

The Windows Registry stores configuration information for the operating system, applications, users, and hardware. This data is contained in sections ( keys) and parameters ( values) registry, which are located in a specific root section ( root key), which controls how and when sections and parameters are used.

If you know the paths to the partitions and understand the allowed data types in the partitions, you can use the command REG to view sections and parameters and manipulate them in a variety of ways. REG supports several subcommands:

  • REG add- adds a new subsection or element to the registry;
  • REG delete- deletes a subsection or element from the registry;
  • REG query- displays a list of section elements and subsection names ( if they are);
  • REG compare- compares subsections or registry elements;
  • REG I'm sorry- copies a registry element to the specified partition path on a local or remote system;
  • REG restore- writes previously saved subsections, elements and parameters to the registry;
  • REG save- saves a copy of the specified subkeys, elements and registry settings to a file.

System Services Management

Services provide key functionality for workstations and servers. To control system services on local and remote systems, use the service controller command ( service controller command) S.C., which has a set of subcommands, only part of them is described below:

  • SC config- setting up accounts for registering and running services;
  • SC query- display a list of all services configured on the computer;
  • SC qc- displaying the configuration of a specific service;
  • SC start- starting services;
  • SC stop- stopping services;
  • SC pause- suspension of services;
  • SC continue- resumption of services;
  • SC failure- specifying actions to be performed when a service fails;
  • SC qfailure- View actions taken when a service fails.

In all commands you can specify the name of the remote computer whose services you want to work with. To do this, insert the UNC name or IP address of the computer before the subcommand you are using. Here's the syntax:

Sc ServerName Subcommand

Reboot and shutdown systems from the command line

Systems often have to be rebooted or shut down. One way is to use the Shutdown utility for this, which allows you to work with local and remote systems. Another way to control system shutdown or reboot is to assign a shutdown task. Here you can use Schtasks to specify a shutdown time, or create a script with a list of shutdown commands for individual systems.

The following commands allow you to control the reboot and shutdown of the local system.

Shutting down the local system:

Shutdown /s /t Shutdown Delay /1 /f

Shutdown /r /t Shutdown Delay /1 /f

Application, process and performance management

Whenever the operating system or user starts a service, application, or command, Microsoft Windows starts one or more processes to manage the associated program. Several command line utilities will make it easier for you to monitor and manage programs. These utilities include:

  • Pmon (Process Resource Manager) - Shows performance statistics, including memory and CPU usage, and a list of all processes running on the local system. Allows you to receive detailed " pictures» resources involved and processes performed. Pmon comes with the Windows Resource Kit;
  • Tasklist (Task List) - lists all running processes by name and process ID, reports information about the user session and occupied memory;
  • Taskkill (Task Kill) - stops the execution of a process specified by name or identifier. Using filters, you can stop processes depending on their state, session number, CPU time, memory footprint, user name, and other parameters.

That's basically all I wanted to tell you about the basics of the Windows command line.

Command line or as it is also called cmd in the Windows 8 operating system is the same as in younger versions of Windows 7, Windows Vista, Windows XP, it follows that the same commands work the same in all versions.

So let's first figure out how to launch the command line. To do this, you must have a working computer with an operating system.

Some commands, if you are running under a regular user account, may not have enough rights to execute them for security reasons, so always run the command prompt with administrator rights. There are 2 ways to launch the command line:

In the window that appears, write cmd and click OK.

A command prompt window will open with a black background.

2) A faster way: through the hot keys Win + R, here also in the window that appears we write cmd, press ok.

In Windows 8, you can only use method 2, since there is no Start menu. Let's write our first help command, which will display a list of all available commands with brief explanations.

List of all existing Windows command line commands:

ASSOC Print to screen or modify mappings based on file name extensions.
ATTRIB View and modify file properties.
BREAK Locks or unlocks enhanced CTRL+C processing in DOS.
BCDEDIT Sets properties in the boot database that allows you to control the initial boot.
CACLS Lists data and modifies access control lists (ACLs) on files.
CALL Calls one batch file from another, and can also pass input arguments.
CD
CHCP Output or set encoding.
CHDIR Displays the name or moves to another folder.
CHKDSK Diagnostics of the drive for errors.
CHKNTFS Shows or changes drive diagnostics during boot.
CLSO clearing the display of all symbols.
CMD Launches a Windows command line program. You can run an infinite number of them on one computer. They will work independently of each other.
COLOR Changes and sets the main background of the window and the fonts themselves.
COMP Shows differences and compares the contents of two files.
COMPACT Changes and shows file compression in NTFS.
CONVERT Converts FAT disk volumes to NTFS. The current drive cannot be changed.
COPY Creates a copy of a file or files and places them in the specified location.
DATE Shows or sets the current date.
DEL Destroys one or more files at once.
DIR Shows the names of files and folders with their creation date located in the current folder or specified in the folder settings.
DISKCOMP Compares and shows the differences between 2 floppy drives.
DISKCOPY Creates a copy of the contents of one floppy drive to another.
DISKPART Shows and changes the properties of a disk partition.
DOSKEY Modifies and re-invokes command lines; creates macros.
DRIVERQUERY Displays information about the status and attributes of a device driver.
ECHO Displays text information and changes the display mode of commands on the screen.
ENDLOCAL Brings the environment localization to a close for the batch file.
ERASE Destroys a file or files.
EXIT Terminates the command line program
F.C. Shows the differences between two files or two sets of files and also compares them
FIND Searches for a text string in files or in one file.
FINDSTR Advanced search for text strings in files.
FOR Cycle. Repeats execution of the same command a specified number of times
FORMAT Formatting the drive for use with Windows.
FSUTIL Shows and sets file system attributes.
FTYPE Allows you to change and view file types, which are mainly used when matching by file name extensions.
GOTO Transfers control to another specified command.
GPRESULT Displays Group Policy information for a computer or user.
GRAFTABL Allows Windows to display extended characters in graphical mode.
HELP Lists all data about existing Windows commands.
ICACLS Shows, modifies, archives, or restores ACLs for files and folders.
IF Executes commands based on a given condition.
LABEL Creates, modifies, and destroys volume labels for drives.
M.D. Creates an empty directory.
MKDIR Creates an empty directory.
MKLINK Creates symbolic and hard links
MODE Configures system devices.
MORE Sequentially displays information in blocks the size of one screen.
MOVE Moves files from one location to another.
OPENFILES Shows files that are open on a shared folder by a remote user.
PATH Displays or sets the full path to executable files.
PAUSE Stops execution of command line commands and displays information text.
POPD Restores the previous active folder value that was saved using the PUSHD command.
PRINT Prints the contents of a text file.
PROMPT Modifies the Windows command line prompt.
PUSHD Saves the active folder value and moves to another folder.
R.D. Destroys a directory.
RECOVER Revives readable data from a bad or damaged hard drive.
R.E.M. Places comments in batch files and the CONFIG.SYS file.
REN Changes the name of both files and folders.
RENAME Similar team REN.
REPLACE Swaps files.
RMDIR Destroys a directory.
ROBOCOPY Advanced tool for copying files and entire folders
SET Shows, sets, and destroys Windows environment variables.
SETLOCAL Localizes environment changes in a batch file.
S.C. Allows you to work with services
SCHTASKS Allows you to run any programs and sequentially execute the necessary commands according to a given plan
SHIFT Changes the position (shift) of substituted parameters for a batch file.
SHUTDOWN Shuts down the computer.
SORT Sorts input according to specified parameters.
START Launches a program or command in a new window.
SUBST Assigns a drive name to the specified path.
SYSTEMINFO Displays information about the operating system and computer configuration.
TASKLIST Shows a list of all running processes with their IDs.
TASKKILL“Kills” or stops the process.
TIME Sets and displays the system time.
TITLE Sets the window name for the current session of the command line interpreter CMD.EXE
TREE Displays drive directories in a convenient visual form.
TYPE Displays the contents of text files.
VER Displays brief information about the Windows version.
VERIFY Checks for file writing errors on the drive.
VOL Displays the labels and serial number of the drive volume.
XCOPY Creates a copy of files.
WMIC Prints WMI on the command line.

About two decades ago, there was no Start menu or taskbar. The friendly GUI we know didn't exist back then, but was instead a black screen with a blinking cursor. But if you need to access some elements of Windows, you will still have to open the Command Prompt or CMD:

If you've never used the command line, this guide will help you get up to speed and tell you some CMD commands you should know in case of emergencies.

To access it in Windows 7 or higher, you can type in the search bar "Start" menu " cmd" or " command line" You can also find it here: Start Menu - All Programs - Accessories - Command Prompt. You can find a complete list of parameters for each of the commands below on the Microsoft website.

Please note that the commands are not case sensitive and you need to press Enter to execute them.


Basic Command Line Commands

DIR is short for Directory, this CMD command for a beginner Lists all files and folders in a specific directory. As well as their size, extension and free space remaining on the disk. The command can be modified with additional parameters such as DIR /p ( lists pages by page), DIR /q ( displays information about the site owner), DIR /w ( lists in extended format with the maximum number of files per line), DIR/d ( displays a list in an expanded format, divided into columns), DIR /n ( prints a long list in one line), DIR /l ( prints an unsorted list of directory and file names in lowercase), DIR /b ( displays a list of files without additional information). DIR /s lists the files and directories of a given directory, as well as all subdirectories. By entering DIR/? , you will see a list of all available options.

CD or CHDIR command ( Change Directory) is intended to change the directory. The command performs several operations. CD takes you to the very top of the directory tree. CD.. moves you to the parent directory of the current one. CD directory-name takes you to that directory. Type CD to display the current directory name.

MD or MKDIR ( Make Directory) allows you to create a directory (folder). To create a directory, use the following syntax: MD directory-name .

CLS clears the screen. This CMD command in Windows is used if the command line emulator is filled with a list of commands and their operations.

EDIT filename allows you to change the contents of the file.

The DEL command allows you to delete one or more files. Alternatively, you can use the ERASE command. To delete a file, use the DEL filename syntax.

If you want to delete all files with a specific extension, then enter DEL *.doc and all files with the doc extension will be deleted from the current directory. DEL *.* removes all files from the current directory, so be careful with this command.

RD or RMDIR - You can use this command to delete a folder, but the folder must be empty. The syntax is quite simple. Enter RD foldername. If you want to delete a folder that is not empty, you can use RD /S foldername. Be careful with this command as it permanently deletes the folder and all its contents.

RENAME , or REN, renames a file or directory. The syntax of this computer control CMD command is as follows: RENAME current-name new-name. For example, if you want to rename a file named iPhone.txt to iPad.txt , enter RENAME iPhone.txt iPad.txt .

MOVE allows you to move one or more files from one directory to another. For example, if you want to move the file 1.txt located in the current directory to a folder named Numericals inside the current directory, enter MOVE 1.txt Numericals .
If you have tried to rename a directory (folder) using the RENAME command in the above way, then you know that it does not work. The MOVE command will help us with this, since it can also be used to rename directories. Type MOVE current-name new-name, where current-name is the name of the directory in the current folder.

The COPY command allows you to copy one or more files from one location to another. The command allows you to merge files of the same type. Let's look at various examples of using the COPY command:

  • COPY filename foldername will copy the file filename to an existing folder;
  • COPY filename new filename creates a copy of the file with a new name;
  • COPY *.doc Word copies all files with a .doc extension to a folder named Word.

The CMD basic command XCOPY is for files and directories, including subdirectories. The simplest way to use it is to copy all the files from one drive to another. Syntax: XCOPY Source-drive: Destination-drive: /e, where the /e option allows you to copy all subdirectories, even if they are empty. Use /s to prevent copying of empty directories. You can use the folder names of the source drive or destination drive to simply copy the entire contents of one folder to another.

Additional commands

The FORMAT command in CMD allows you to erase information from the hard drive or prepare it for copying data if you installed a new disk. The syntax to use the command is: FORMAT drive: . If you want to reformat a specific drive for a specific file system, you can do this using the command: FORMAT drive: /fs: file-system, where filesystem can be: FAT, FAT32 or NTFS. After applying the command, all data from the disk will be erased without a trace.

FC - Used to compare two files with each other. Let's say you have two files gadgets360_1.txt and gadgets360_2.txt . To compare them, you need to enter the following command: FC gadgets360_1.txt gadgets360_2.txt.

IPCONFIG displays detailed information about the network settings: IP address, and also reports the type of network connection of your computer (using Wi-Fi or Ethernet). Type IPCONFIG /ALL to get an overview of all network settings, including which DNS servers you are using. Enter IPCONFIG /RENEW to obtain a new IP address from the DHCP server. This may help if you are having problems connecting to the Internet.

CMD ping command - If you are not sure whether the site you want to visit is accessible, enter PING followed by the IP address or domain name. For example, PING google.com. If Destination Net Unreachable appears on your screen, you may not have an Internet connection. If the Host is down or Request timeout messages appear, the site may be unavailable. If everything is ok, you should see something similar to this: 64 bytes from 173.194.36.73: icmp_seq=0 ttl=56 time=118.355 ms.

The SHUTDOWN command may be useful to you if the " Shutdown" in the Start menu is not working due to malware. To shut down your computer (for Windows) enter Shutdown /S . To restart the computer - Shutdown / R.