For those of you who do not know what we are talking about in these lines, it should be clear that this is not about anything else but a command line from which we can carry out multiple tasks based on written commands. Generally, these are executed internally and automatically when performing all kinds of actions in the aforementioned Graphic interface. However, from the CMD the most advanced users will have much more control over all of this.
As a curiosity, we will tell you that the CMD we are referring to is the abbreviation of CoMmanD and it is a Microsoft program that comes from the mythical command.com. This is the command interpreter MSDOS that has been with us for decades, in a more or less visible way. In the early days of the Microsoft operating system, everything worked based on commands like the ones we are going to show you in these lines. But with the passage of time this has been falling into disuse, moving to more comfortable and visual graphical interfaces.
In this way, from this section we can carry out a multitude of tasks in the systemall this by typing direct commands to it.
How to open the Windows CMD
Therefore, for those of you who are interested in discovering this section of the operating system of those of redmond, we will tell you how to execute it. First of all, you have to know that it is part of Windows itself, we will only have to start it. To do this we must go to the search box on the Start menu, for example, and write cmd.
At this point it is worth mentioning that what is recommended in this case is to execute all this with administrator permissions. This way we can carry out more complex tasks with greater control over the operating system. Therefore, once the icon with the executableclick with the right mouse button on it to be able to execute with permissions of administrator.
Advantages of running CMD with administrator permissions
Something that we must keep in mind once we have reached this point is the way in which we execute this Windows functionality. And it is that as with the rest of the applications that we have installed on the PC, we can execute the CMD in different ways. In just opening the file in a conventional way, we access the command prompt window with certain permissions blocked. This can be very useful for us so that we cannot make dangerous changes that could even damage Windows itself.
But, on the other hand, if we are users with some experience in the system of those of redmondand we also know the power that CMD presents to us, we should execute it with permissions administrator. That, as you can imagine, gives us access to more advanced functions of Windows itself. These, as a general rule, will refer to more intense and therefore delicate changes that will allow us to adapt the operating system itself to the maximum, all based on advanced commands. But as we mentioned before, for this it is preferable that we know very well what we are doing so as not to damage the software.
What is PowerShell and how is it different from CMD?
As we told you, the CMD or command prompt has been with us for many years, since the beginning of the Microsoft operating system. Initially the original MSDOS shell and the default shell in Windows 10 were the same for a long time and was the system default. But after the appearance of PowerShellthis changed a bit, as this improved version of executing commands went a bit further.
And it is necessary to take into account that Windows PowerShell allows us to carry out more complete and complex developments, works and executions, all based on commands. This element is an advanced scripting language written in Microsoft .NET Framework that allows you to perform tasks in the background or automate tasks. Therefore, it could be said that it is an improved and more modern version of the aforementioned CMD. Thus, to open it, as in the previous case we write its name in the search box and we also run with administrator permissions.
The most important basic CMD commands
Once we know all this, we are going to show you a series of basic commands of which you can use the aforementioned CMD. Knowing everything that surrounds the command prompt is nothing more than acquiring some experience in the use of the commands that we are going to need the most.
As we get used to all this, we can go deeper with parameters that allow us to squeeze them a little more. Of course, something that we must keep in mind is that these parameters that we are talking about, you can see by writing Help followed by command from which we want to see those parameters.
Commands for working with files
One of the most common tasks for which we use the command line window in Windows is to work in a more controlled way with files and folders. In this way, thanks to the different commands that we use for all this and their corresponding parameters, we could better manage our content. Although at first it may seem a bit cumbersome, once we have memorized the main orders in this regard, we will see how useful it all is.
Thus, these are the CMD commands that focus on working and dealing with the files that we have stored on the drives in many ways and in depth.
- ATTRIB: allows us to see as well as modify the attributes of any file on the computer in order to expand its usability. We can indicate it as solo readingfor total control, just writing, etc.
- COMP: compares the content of two files or a set of files directly and thus obtain detailed information on both contents.
- COMPACT: allows us to see as well as modify the compression status of the files indicated in the command, all of which is valid in NTFS partitions. This allows us to see in depth certain data of the referenced files.
- COPY: allows us to copy one or more files to another location on the hard drive. Handling this particular command allows us to handle disk contents more quickly.
- DEL: deletes one or a set of specified files from those saved on the computer. This is a particularly important task on a day-to-day basis with our archives.
- ERASE: command to delete one or a group of files that we previously indicate.
- FC: allows us to compare two or more files and also offers us as output the
- differences between all those specified.
- FIND: to search for a string text in one or more files that we indicate in the same command.
- FSUTIL FILE CREATENEW: allows us to create any type of file, and specify the size we want it to have.
- FTYPE: shows on the screen the file types used in the extensions that we indicate. It also allows us to modify those associated types
- MOVE: to move one or a group of files from one directory to another or to the location that we indicate.
- RENAME: command to change the name of one or a group of files.
- REPLACE: to replace files.
- ROBOCOPY: tool for efficient file copying.
- TYPE: allows you to see the content of any file from CMD.
Commands for working with directories
As with the individual files that we have mentioned in the previous section, folder management is also extremely important. All this will allow us to work with large amounts of files simultaneously, controlling the entire process to the maximum. Precisely for this it is interesting to memorize some of the commands that we will talk about below.
It is worth mentioning that here we are going to find a series of commands that allow us to manually manage the directories saved on the PC’s drives.
- CD: allows us to move between the system folders by writing the command and the destination path. It also shows the name of the current directory by itself. If we write the unit as is, followed by a colon (for example, d:) we will change to that unit.
- CHDIR: lets us see the name of the current directory or changes to another, much like CD.
- COPY: command that allows us to copy files from one directory to another.
- DIR: shows a list of all the files and subdirectories in which they are located in the current directory or in any other that we indicate.
- MD: create a new folder in the current directory.
- MKDIR: to create a new directory.
- MOVE: allows us to move a directory to another site. It would be the equivalent of “cut”.
- REN: Allows you to rename files and folders.
- RD: to delete a directory.
- TREE: allows us to visualize in tree form the directory structure of a complete disk unit, or of a directory that we specify
- XCOPY – Allows you to copy both single files and entire directory structures.
network commands
It is very likely that the most experienced users of the Microsoft operating system will appreciate the use of the commands that we will mention now. These allow us to work in a more effective and personalized way, with the different network functions that we usually use from the graphical interface of the operating system.
If you want to know all the details of your Internet connection or the local network, you cannot miss these commands to execute from the CMD.
- GETMAC: allows us to know the MAC address of our computer.
- IPCONFIG: allows us to visualize all the information of the equipment’s network cards in detail.
- PING: this is a command that allows us to easily check the status of our connection. In the case of detecting problems, it serves to identify their cause.
- TRACERT – Establishes a path from the local machine to the destination server and shows all the hops the connection makes until it reaches the endpoint and see where there may be particular connection errors.
- NETSAT: allows us to control, analyze and diagnose a network from the CMD, it also allows us to know the connections that are open on the PC, both local and remote.
- NSLOOKUP: allows us to know if the DNS server that we have configured by default is correctly translating the URLs to the corresponding IP addresses.
- NBTSTAT: to see the statistics of the TCP/IP protocol and the current connections that are established in the equipment.
system commands
Surely most of you already know that Windows offers us a good number of integrated functions to optimize the system. But this is also something that we can control manually from the command line or CMD, as we are going to show you below.
In this section we find a list of CMD commands to manage some very important parts related to the operation and behavior of the operating system itself.
- CHKDSK: powerful command for disk drives that checks their integrity and offers a report on the status of each one of them.
- CHKNTFS: allows us to see in addition to modifying the disk check when starting the operating system.
- CLEANMGR: allows you to clean hard drives of unnecessary files.
- CLS: clears the screen active by…