Each command prompt offers various options, the options being passed using a slash (forward slash /), which in principle gives command/option. In the same way, we can cumulate the options: Which gives: command / option1 / option2.
Combining options with CMD
In other cases, the options are obtained with the minus sign –
Which gives the command -option?
They are cumulative just by adding the various letters provided in the options
Which gives the command -option1option2?
Order option with -Order option with – (dash)
Delete a file using the command:
del file name or del / parameter filename
Example: del / P file
request deletion confirmation
Deleting files with del
Redirect the result of a command to a file: Instead of seeing the output of the command directly in the CMD window, you can save it in a file by redirecting:
Command > file name
Redirect the result of an order to a file
If you want to save the file in a particular folder, you must indicate the full path:
Command> C: \ My_folder \ my_file.txt
Place two orders one after the other
The ampersand or ampersand, which is sometimes called “and commercial” & allows you to place several orders one after the other.
command1 & command2
Place two orders one after the other
Several commands nested with & the parentheses and the ampersand allow you to nest several commands:
The results will be interpreted one after the other.
Several commands nested with (&)Several commands nested with (&)
The advantage of nested commands allows, for example, to save the result of two commands in a single file as in the example below:
Nested commands
Execution of the 2nd order even if the 1st is not good: In the same way, we can place two orders, the first of which may not be good the second order will be carried out anyway. To do this, we use the pipe key which we obtain using Alt Gr + 6.
A direct inheritance from MS-DOS, the first operating system from Microsoft, the command prompt is an administrative tool for entering commands. This command prompt allows you to perform a whole bunch of operations and all this without the need for a graphic interface. The advantage of these commands is that it is possible to make serial adjustments to the computer or Windows, using small programs or scripts that you can write. Traditionally used by experienced users, the command prompt is not necessarily an intuitive tool, but you will see that it responds to precise logic that is easy to learn. You will then be able to manage your files more finely, change security settings, or even create a virtual hard disk. With the command prompt, you will also have access to additional tools for network management such as “ping”, “tracer”.
The past
If Windows is known as the name of a family of operating systems developed by Microsoft, it is not the only operating system from Microsoft. In the 80s and 90s, the Redmond Company was also known for MS-DOS (Microsoft Disk-Operating-System), a command-line operating system.
With MS-DOS, all operations were performed using commands. Want to start a program? So you had to navigate in the tree of your hard disk or your floppy disks using the “cd” and “dir” commands, then enter the name of the program executable. The heart of MS-DOS was the executable “command.com” which contained all the basic commands.