Cmd. exe - what is it? Cmd. exe - application error

The Windows command line, although it is popular with administrators and experienced PC users, is not known to ordinary owners of personal computers. The purpose of this article is to familiarize people with the benefits that they will receive from its use.

The Windows operating system is known for its graphical interface, and many users have already forgotten or never heard of useful command line functions. Windows is more than just pointing and clicking. The keyboard and command line can significantly complement the mouse with icons.

Cmd.exe - what is it?

The command line appears when cmd.exe starts. This is a MS Windows system process, as well as a command interpreter that supports PC file and network functions. Cmd.exe works by loading applications and redirecting data between them. The process translates the data entered into the system into a form understandable by the operating system. Cmd.exe operates with a number of built-in commands executed in the shell environment.

cmd exe what is it

The latter is a program that provides direct communication between the user and the operating system. Used to create and edit scripts (batch files) for different purposes. For example, to manage user accounts. Using a shell program makes it possible to automate some operations. This is much faster than resorting to external programs. You can also customize the command window to your taste and control the execution of tasks.

Command line call

The command line can be called by launching the application in the system directory System32 \ cmd.exe. What, is it complicated? There are other options:

  • Through the menu "Start - All Programs - Windows System - Command Prompt."
  • Go to the “Start” menu, type cmd in the search box and run “Command Prompt”.
  • Call the application launch window with the Win + R key combination, enter cmd and click the "Start" button.
  • By right-clicking on the Start menu, bring up a pop-up window and select the item you need. To run the application with administrator rights, select the item "Command line (administrator)".
  • Right-clicking with the Shift and Alt keys pressed in the “File Explorer” will bring up a context menu in which you must select the item “Open command window here”. As a result, the command line will start in the selected directory.

To pin System 32 \ cmd.exe to the Start menu, right-click on the program and select the item “Pin to Start menu” in the context menu.

cmd exe application error

Configuration

You can configure the command window by clicking the right mouse button on its title bar and selecting “Default”. The selected configuration will be saved for subsequent cmd.exe sessions. To set the settings only for the current session, use the "Properties" item.

Here you can select the font settings, window size and location, text color, background, transparency.

If you select the "Select with mouse" option, you can select the text with the left button of the manipulator pressed, and use the "Enter" key to copy it to the clipboard.

You can also set the colors of the command window when starting Cmd.exe with the / t: fg parameter, where f sets the color of the text and g sets the background as a hexadecimal digit from 0 to F: black (0), blue (1), green (2 ), sea wave (3), red (4), violet (5), yellow (6), white (7) and their light shades in the same order with codes from 8 to F.

cmd exe start

Cmd.exe keys: what is it?

When you run the command line, other keys are used. The syntax for starting the Cmd.exe application is as follows:

cmd [[{/ c | / k}] [/ s] [/ q] [/ d] [{/ a | / u}] [/ t: fg] [/ e: {on | off}] [/ f: {on | off}] [/ v: {on | off}] string], where:

  • c executes the command specified by the line and terminates the application;
  • k executes the command given by the line and continues the application;
  • s changes the interpretation of the line after the / c or / k keys;
  • q disables screen output;
  • d disables autorun ;
  • a sets the output to the ANSI standard;
  • u sets the output in Unicode;
  • t: fg sets the color of text and background;
  • e: {on | off} enables and disables the use of an extended set of commands;
  • f: {on | off} enables and disables the completion of a file or directory name;
  • v: {on | off} enables and disables the deferred extension of the environment variable written between! during command execution;
  • "String" sets the command to be executed;
  • /? displays help in the command window.

Several teams at once

In the command line specified as a parameter, you can specify two or more Cmd.exe commands. To do this, enclose the string in quotation marks, and separate the commands using the sequence of characters &&.

The same command separator is used on the command line itself. Here it is called the And operator: command_1 && command_2: if command_1 was executed successfully, then command_2 will be executed.

The command join statement &: command_1 & command_2: command_2 will be executed after the command command_1.

OR operator: command_1 || command_2: command_2 will be executed if command_1 cannot be executed.

Pipeline operator |: command_1 | command_2: data at the output command_1 is redirected to the input command_2.

Commands are grouped using parentheses: (command_1 & command_2) || command_3: if command_1 and command_2 are not executed, then command_3 will be executed.

If multiple commands have more than one parameter, then they are separated by semicolons or semicolons: command_1 parameter_1; parameter_2

Some other operators:

  • command > file redirects the output of the command to a file, creating it or overwriting the existing one;
  • command >> file adds the output of the command to an existing file or creates a new one;
  • the < file command uses the contents of the file as input to the command;
  • @echo off is used in batch files to disable the output of commands to the screen.

cmd exe team

Hotkeys

When working with the command line, you can and should use the hot keys:

  • Button ↓ / ↑ - iterates over previously typed teams.
  • Backspace - erases the character to the left of the cursor.
  • Ctrl Home - erases the line to the left.
  • Ctrl End - erases the line to the right.
  • Ctrl ← - moves the cursor one word to the left (back).
  • Ctrl → - moves the cursor one word to the right (forward).
  • Ctrl-C - interrupts the execution of the current command.
  • Esc - clears the command line.
  • F1 - equivalent to pressing the right arrow. Each press of it introduces one character of the last command into the command line in order.
  • F2 - displays the last command before the character pressed after the function key.
  • F3 - Enter the last command completely.
  • F4 - deletes the command before the character entered after pressing the function key.
  • F5 - equivalent to the up arrow, enters the last command in turn.
  • F6 - meets the key combination Ctrl + Z and inserts the character of the end of the EOF file.
  • F7 - displays a window with a list of previously typed commands.
  • Keyboard shortcut Alt + F7 - deletes the history of commands.
  • F8 - equivalent to F5 with cyclic repetition. If you press F8 after entering the initial characters of the previously entered command, the program will fill it to the end.
  • F9 - inserts a command whose number in the history of commands corresponds to the number dialed after the function key.
  • Insert - Toggles the insert / rewrite input mode.
  • Tab - automatically fills the name of the folder or file, sorting through the options with each subsequent click. Shift + Tab changes the direction of iteration.

Internal and external teams

Two types of commands can be used in the console - internal and external. Internal ones are built into the interpreter and can only be run from the command line. External ones are launched by a separate executable file both from the console and from the Start - Run menu item. A list of them can be obtained using the help command. And more detailed information can be obtained after entering “help command” or “command /?”. For example, to get help about xcopy, type help xcopy or xcopy /?

system32 cmd exe

Teams for everyone

Many console commands are network and administration oriented, which is why system administrators often use them. But there are cmd.exe commands that are available for the average PC user. Below are some of them.

1. Del / s folder \ * - removes contents from the specified directory and all subfolders. Another / f switch will erase read-only files. With absolute confidence in this operation, adding the / q switch eliminates the need to confirm each deletion. The command should be used with caution, since documents deleted in this way do not fall into the basket.

2 . Mkdir (or md) can create an entire directory tree: md folder_1 \ folder_2 \ folder_3 .

3. Xcopy offers ample opportunities for regular and backup of a large number of files. For example, the key / d: [mm-dd-yyyy] will allow you to operate only with documents that have been changed after the specified date. An additional switch / s will allow copying subfolders as well. In total, the team has 27 keys.

4. To remove a directory rmdir (or similar rd) will help. In this case, the folders should be empty. The / s switch allows you to get rid of the subdirectories along with their contents. An additional switch / q is also possible.

5. Dir folder \ *. Doc / h / s> list.txt will create a file with a list of MS Word documents in the specified directory, including hidden files (thanks to the / h switch) and documents in subfolders (/ s switch).

6. You can change the file extension using the ren * .txt * .doc command .

7. Move / y folder_1 \ *. Mp3 folder_2 \ will move mp3 files from folder_1 to folder_2 without confirming the overwrite. Conversely, the / -y switch will prevent such overwriting.

8. Cmd.exe start. will open the current directory in Windows Explorer.

9. Cmd.exe start .. will open a folder in Windows Explorer one step higher than the current one.

10. The System32 \ cmd.exe start shell: cookies command will open the system folder with Internet cookies. For operating systems prior to Windows 7, the cmd.exe command is even simpler: start cookies.

11. Attrib -r -s -h file will remove the read-only, system, and hidden file labels.

12. Subst z: the folder will facilitate access to the folder by giving it the name of drive Z.

Batch file

In addition to the command line, Cmd.exe is able to process batch files - text documents with the extension .bat or .cmd, containing command lines that are executed in turn.

A batch file is able to use arguments - user data transmitted in a certain form:% 1,% 2. During execution, these parameters are replaced by user data.

The command set / p variable = [line] allows you to transfer variable values ​​to a batch file. For example, set / p name = What is your name? creates the variable% name% with the value entered by the user.

Batch files can make decisions and choose actions depending on conditions:

  • If (condition) (command_1) Else (command_2) - when the condition is met, command_1 will be executed, otherwise _ command_2;
  • if exist file del file - the file will be deleted if it exists;
  • if not exist file echo file missing - if the file is missing, the batch file will report it;
  • if / i line_1 gtr line_2 command - the command will be executed if line_2 is greater than line_1 case insensitive (key / i).
  • goto: label let go to the label, leaving some of the commands without execution.
  • for %% X in (* .jpg) do (command) - allows you to execute the command for all files with the extension .jpg.

system32 cmd exe start

Safe process shutdown

The file Cmd.exe is system. It is highly recommended that you do not delete it and do not stop the processes that it is running. They are very important for the correct operation of the computer. If the need to stop the process still arises, you need to do the following:

1. Go to the "Start" menu, type Msconfig in the search box and run the utility. A window appears listing the system configuration tools.

2. Selecting the StartUp tab, check for the presence of Cmd.exe in the list.

3. Uncheck the box next to the process name, apply the changes and restart the computer.

4. After rebooting, uncheck the system configurator automatically starts when you turn on the PC.

Another way is to check the list of automatically started processes in the register editor.

Cmd.exe can be stopped using the task manager in the process tab. To do this, select the process and click on the "End the process" button.

Causes of Errors

The Cmd.exe Application Error message is most often the result of damage to the operating system system files. Because of this failure, computer performance is affected. Also, problems in system processes arise due to incompatibility of applications, incomplete deletion of files, infection with computer viruses, improper operation of programs, etc. All this can lead to the removal or damage of important system files.

windows 7 cmd exe

How to fix Cmd.exe errors

One thing about Cmd.exe errors is that this is a fixable thing. One solution will not help, so there is another. Here is some of them.

  • Log in to the operating system with administrator privileges.
  • Undo the latest changes, after which the Cmd.exe Application Error message appears. And if it appears during the launch of the same program, then delete or reinstall it.
  • Ensure reliable protection against viruses. You should scan your computer and eliminate unwanted programs.
  • One of the most common causes of this error is registry corruption. This is a ranked database, which contains information about the configuration, email addresses, passwords, file paths and other information necessary for the normal operation of the PC. To remedy the situation, you can use the registry cleaner utility Registry Cleaner.
  • Updating the video card driver from the official website of the manufacturer.
  • Reinstalling DirectX, NetFramework, Microsoft Visual C ++ from the official Microsoft website.
  • Running exe cmd-command sfc / scannow as administrator. The system utility will scan your PC for errors and suggest ways to resolve them.

Source: https://habr.com/ru/post/K12492/


All Articles