ComputersProgramming

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

The Windows command line, although popular with administrators and experienced PC users, is not known to ordinary personal computer owners. 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 point and click. The keyboard and command line can essentially supplement the mouse with icons.

Cmd.exe - what is this?

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

The latter is a program that provides a 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. The use of the command shell program makes it possible to automate some operations. This is much faster than using external programs. You can also customize the command window to your taste and monitor the execution of tasks.

Calling the command line

The command line can be invoked by running the application in the system directory System32 \ cmd.exe. Is it difficult? There are other options:

  • From the "Start - All Programs - Windows System - Command Prompt" menu.
  • Go to the "Start" menu, type cmd in the search window and launch "Command Line".
  • Call the application launch window with the Win + R shortcut, type cmd, and click the "Start" button.
  • Right-click on the "Start" menu to call up a pop-up window and select the item you want. To start the application with administrator rights, select the "Command line (administrator)" item.
  • Right-clicking with the Shift and Alt keys simultaneously pressed in File Explorer will bring up a shortcut menu in which you need to select the Open command window here. As a result, the command line will run in the selected directory.

To fix System 32 \ cmd.exe in the Start menu, right-click on the program and select "Pin to Start Menu" in the context menu.

Configuration

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

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

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

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

Cmd.exe keys: what is this?

When you start the command line, you use other keys. The syntax for running 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 string and terminates the application;
  • K executes the command specified by the string, and continues the application;
  • S changes the interpretation of the line after the / c or / k keys;
  • Q disables output to the screen;
  • D disables autorun ;
  • A specifies the output in the ANSI standard;
  • U specifies the output in Unicode;
  • T: fg sets the color of the text and background;
  • E: {on | off} enables and disables the use of the extended command set;
  • F: {on | off} enables and disables the completion of the file or directory name;
  • V: {on | off} enables and disables the deferred extension of the environment variable written between!, At the time the command is executed;
  • "String" specifies the command to be executed;
  • /? Displays help in the command window.

Several commands at once

In the command line specified as a parameter, you can specify two or more Cmd.exe commands. To do this, the string must be enclosed in quotation marks, and the commands should be separated using the && symbol sequence.

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

The operator for connecting commands &: command_1 & command_2: command_2 will execute after the command command_1.

OR operator: command_1 || Command_2: command_2 will be executed if command_1 can not be executed.

Conveyor operator |: command_1 | Command_2: the output of command_1 is redirected to the input command_2.

Grouping of commands is made with the help of parentheses: (command_1 & command_2) || Command_3: if command-1 and command-2 are not executed, then command-3 is executed.

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

Some other operators:

  • Command > file redirects the output of a command to a file, creating it or overwriting an existing one;
  • Command >> the file adds the output of the command to an existing file or creates a new one;
  • Command < file 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.

Hotkeys

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

  • Button ↓ / ↑ - it sortates the previously typed commands.
  • 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 (backward).
  • Ctrl → - moves the cursor one word to the right (forward).
  • Ctrl-C - interrupts execution of the current command.
  • Esc - clears the command line.
  • F1 - is equivalent to pressing the right arrow. Each time it is pressed, it enters the last command in the command line in order.
  • F2 - outputs the last command to the character pressed after the function key.
  • F3 - enters 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 commands in turn.
  • F6 - responds to the key combination Ctrl + Z and inserts the end-of-file character EOF.
  • F7 - displays a window with a list of previously typed commands.
  • The shortcut Alt + F7 - deletes the command history.
  • F8 is equivalent to F5 with cyclic repetition. If F8 is pressed after entering the initial characters of the previously entered command, the program will fill it up to the end.
  • F9 - inserts a command whose number in the command history corresponds to the number dialed after the function key.
  • Insert - toggles the insert / overwrite input mode.
  • Tab - automatically fills the name of a folder or file, scrolling through the options with each subsequent click. Shift + Tab changes the direction of the search.

Internal and external commands

Two types of commands can be used in the console: internal and external. Internal are built into the interpreter and can be run only from the command line. Externals are started by a separate executable file both from the console and from the menu item "Start - Run". You can get their list using the help command. And more detailed information can be obtained after entering "help command" or "command /?". For example, to get help on xcopy, type help xcopy or xcopy /?

Teams for all

Many console commands are network-oriented and administrated, so they are often used by system administrators. But there are also cmd.exe commands that are available for a typical PC user. Below are some of them.

1. Del / s folder \ * - removes content from the specified directory and all subfolders. Another / f switch will erase read-only files. With absolute certainty in this operation, adding the / q switch removes the need to confirm each deletion. The command should be used with caution, since the documents thus deleted are not included in the trash.

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

3. Xcopy opens wide possibilities for normal and backup of a large number of files. For example, the / d: [mm-dd-yyyy] switch will allow you to operate only with documents changed after the specified date. The additional / s switch will also allow you to copy subfolders. In total, the team has 27 keys.

4. Remove the directory will help rmdir (or similar rd). In this case, the folders must be empty. The / s switch allows you to get rid of nested directories along with their contents. An additional key / 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 key) and documents in subfolders (key / s).

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 overwriting confirmation. Conversely, the / -y switch prevents this overwriting.

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

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

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

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

12. Subst z: The folder makes it easier to access the folder by assigning it the name of the Z drive.

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.

The batch file is able to use arguments - the user data passed in a specific form:% 1,% 2. During execution, these parameters are replaced with user data.

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

Batch files can make decisions and select actions depending on the conditions:

  • If (condition) (command_1) Else (command_2) - if the condition is fulfilled, the command _1 is executed, otherwise _ command_2;
  • If exist file del file - the file will be deleted if it exists;
  • If not exist file echo file is missing - if the file is missing, the batch file will report this;
  • If / i string_1 gtr string_2 command - the command will be executed if line_2 is greater than string_1 without regard for the case of characters (key / i).
  • Goto: The label allows you to go to the label, leaving part of the commands without execution.
  • For %% X in (* .jpg) do (command) - allows to execute the command for all files with the extension .jpg.

Safe process shutdown

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

1. Go to the "Start" menu, type Msconfig in the search window and start the utility. A window will appear with a list of system configuration tools.

2. After selecting the StartUp tab, check the presence of Cmd.exe in the list.

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

4. After reboot, uncheck the automatic startup of the system configurator when the PC is turned on.

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

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

Causes of errors

The Cmd.exe "Application Error" message is most often the result of system file corruption in the operating system. Because of this failure, the performance of the computer suffers. Also, problems in system processes occur due to incompatibility of applications, incomplete file deletion, infection with computer viruses, malicious programs, etc. All this can lead to the removal or corruption of important system files.

How to fix Cmd.exe errors

One pleases in the errors Cmd.exe - that this business is fixable. One solution will not help, so there is another. Here are some of them.

  • Login to the operating system with administrator rights.
  • Undo the last changes after which the message Cmd.exe "Application error" appears. And if it appears during the start of the same program, then delete or reinstall it.
  • Make sure of reliable protection against viruses. You should scan the computer and remove unwanted programs.
  • One of the most common causes of this error is registry corruption. This is a ranked database that contains configuration information, e-mail addresses, passwords, file paths, and other information necessary for the normal operation of the PC. To fix this situation, you can use the registry repair utility Registry Cleaner.
  • Update the driver of the video card from the official website of the manufacturer.
  • Reinstalling DirectX, NetFramework, Microsoft Visual C ++ from the official Microsoft website.
  • Run the exe cmd-command sfc / scannow as administrator. The system utility will scan the PC for errors and suggest ways to resolve them.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.birmiss.com. Theme powered by WordPress.