CMD Shortcuts:

CMD Shortcuts:




This document covers the basic in navigating and using the Microsoft Microsoft windows control range. On this web page, you'll learn how to shift around in the control range, learn more, manipulate information, and other important instructions. Keep in mind that there are well over 100 different instructions that have been used in MS-DOS and the Microsoft windows control range. If you're interested in learning every control, see our Microsoft DOS and control immediate help web page, which gives a description and example about each of these instructions.

Get into the Microsoft windows control line

Open a Microsoft windows control range window by following the below steps. If you need more information or alternative methods for all editions of Microsoft windows, see our how to get into DOS and Microsoft windows control range web page.

    Click Start
    In the Search or Run range kind cmd and press enter.

Understanding the prompt

After following the above steps, the below black box will begin, this is the Microsoft windows control range. By standard Microsoft windows will take you to your customers record. In the below example, the user is Mrhope, so we're in the C:\Users\Mrhope record and our immediate is C:\Users\Windows>. From this immediate information we know we're in the C: drive (the standard drive letter of the hard drive) and currently in the Mrhope record, which is a subdirectory of the Users record.

Windows control line

Key tips

    MS-DOS and the Microsoft windows control range are not case sensitive.
    The information and internet directories shown in Microsoft windows are also found in the control range.
    When working with a computer file or record with a space, surround it in quotes. For example, My Documents would be "My Documents".
    Filenames can have a long computer file name of 255 characters and a 3 character computer file expansion.
    When a computer file or record is deleted in the control range, it is not shifted into the Recycle bin.
    If you need help with any of control kind /? after the control. For example, dir /? would give the choices available for the dir control.

Listing the files

Lets learn your first control. Type dir at the immediate to record information in the present record. You should get an outcome similar to the below image example. By standard, without using any dir choices this is how dir outcome will appear. As can be seen, you're given a lot of useful information, the modification or creation date and time, an indication if the listed item is a record (<DIR>), and the actual name of the record or computer file. In the below example, there are 0 information listed and 14 internet directories as indicated by the status at the bottom of the outcome.

Listing information in the Microsoft windows control range

Every control in the control range has choices, which are additional changes and instructions that can be added after the control. For example, with the dir control you can kind dir /p to record the information and internet directories in the present record one web page at a time. This switch is useful to see all the information and internet directories in a record that has dozens or hundreds of information. Each of the choices and changes for each control is listed on our DOS control web page. For example, if you want to see all the choices for dir see our dir control web page for a full record.

In addition to changes, the dir control can also be used to search for specific information and internet directories by using wildcards. For example, if you only desired to record information or internet directories that begin with the letter A you could kind dir a* to record only the AppData record, in this above example. See the wildcard definition for several other examples and help with using wildcards.

Moving into a directory

Now that we've seen a record of internet directories (shown above) available in the present record allows shift into one of those internet directories. To shift into a record, we use the cd control, so to shift into the Pc kind cd desktop and press enter. Once you've shifted into a new record the immediate should change, so in our example, the immediate is now C:\Users\Mrhope\Desktop>. Now in this record allows see what information are found in this record by writing the dir control again.

Windows control range record Pc files

Understand the files

Now in the Pc record in this example (as shown above), we now have 23 information and 7 internet directories. As can be seen in the above example, there are several different computer file types. In Microsoft windows, you're familiar with information having icons that help represent the kind of information. In the control range, the same thing is accomplished by the computer file additions. For example, "forum posts.txt" is a text computer file because it has a .txt computer file expansion, Time.mp3 is a MP3 music computer file, and minecraft.exe is an exe computer file.

    Set of computer file additions and additional help with computer file additions.

For most customers, you'll only be concerned with exe information, which as mentioned above is a computer file that ends with .exe and are also information that end with .com and .bat. When the name of these information is entered the program will run. This would be the same thing as double-clicking a computer file in Microsoft windows to begin the program. For example, if we desired to run minecraft.exe writing minecraft at the immediate will run that program. Keep in mind though that if the exe computer file you're trying to run is not in the present record you'll get a mistake.

If you wish to view the contents of a computer file, most editions of the control range use the modify control. For example, if we desired to look at the log computer file hijackthis.log we would kind modify hijackthis.log at the immediate. For 64-bit editions of Microsoft windows that do not support this control you can use the begin control, for example, kind begin note pad hijackthis.log to begin the computer file in Notepad.

Moving returning a directory

You learned previously the cd control can shift into a record. This control also allows you to go returning a record by writing cd.. at the immediate. When this control is entered you'll be shifted out of the Pc record and returning into the user record. If you desired to shift returning to the root record writing cd\ takes you to the C:\> immediate. If you know the name of the record you wish to shift into, you can also kind cd\ and the record name. For example, to shift into C:\Windows> you would kind cd\windows at the immediate.

Creating a directory

Now with your basic understanding of navigating the control range starting developing. To make a record in the present record use the mkdir control. For example, allows make a record called analyze by writing mkdir analyze at the immediate. If designed successfully you should be returned to the immediate with no mistake message. After the record has been designed, shift into that record with the cd control.

Creating a new set file

Now in the newly designed analyze record allows make your fist computer file. In most situations, you will never need to make any computer file at the control range, however, it's still good to understand how information are designed. In this example, we will be developing a set computer file. A set computer file is a computer file that ends with .bat and is a computer file that can help automate frequently used instructions in the control range. We will be calling this set computer file example, so kind modify example.bat at the immediate. As said before if the modify control doesn't work use the begin control to begin the set computer file in note pad, so you kind begin note pad example.bat at the immediate.

Either of these instructions will begin a new blank window for the example.bat computer file. In the blank computer file, kind the below three lines, which will clear the screen with the cls control and then run the dir control.

@echo off
cls
dir

After these three lines have been entered into the computer file save and exit the computer file. If you're in the modify control Click File (or press Alt+F) and then Save. After the computer file has been saved and you're returning into the control immediate, writing dir should display the example.bat in the analyze record.

Now run the set computer file to get a better understanding of what a set computer file does. To run the set computer file kind example at the immediate. This will execute the set computer file causing it to clear the screen and then do the dir control and display the record listing of the analyze record.

    Full information and additional examples on set information.

Moving and copying a file

Now that we've designed a computer file allows shift it into an alternate record. To help make things easier allows make another record to shift the computer file into. So, kind mkdir dir2 to make a new record in the analyze record called dir2. After the new record has been designed, use the shift control to shift the example.bat computer file into that record kind shift example.bat dir2 which should return a message indicating that one computer file was shifted. You could also substitute the shift control for the copy control to copy the computer file instead of shifting it.

Rename a file

After the computer file has been shifted into the dir2 record allows shift into that record with the cd control so we can relabel the computer file. In the dir2 record allows use the relabel control to relabel the example computer file into an alternate name. Type relabel example.bat first.bat at the immediate to relabel the computer file to first.bat. Now when using the dir control you should see the first.bat as the only computer file.

Tip: When renaming any computer file make sure the computer file has the same computer file expansion. If you were to relabel a .bat computer file to a .txt computer file, it is no longer an exe computer file only a text computer file. Also, keep in mind that renaming the computer file to a different computer file expansion does not convert the computer file. For example, if you were to name the computer file to a .MP3 computer file it may look like a MP3 audio computer file in Microsoft windows, but it is not going to play music.

Deleting a file

Now that we've had our fun with our new computer file allows remove the computer file with the del control. Type del first.bat to remove the first.bat computer file. If successful, you will be returned to the immediate with no errors and the dir control will show no information in the present record.

Tip: When deleting information you can also use wildcards to remove multiple information at once. For example, if the record contained several .GIF image information you could kind del *.gif to remove all information ending with the .gif computer file expansion.

Renaming a directory

Lets go returning one record to get returning into the analyze record by using the cd.. control mentioned previously. Lets now relabel our del2 record to something else using the same relabel control we used previously. At the immediate, kind relabel dir2 want to relabel the record to wish. After this control has been completed, kind dir and you should now see one record called wish.

Removing a directory

Still in the analyze record allows now remove the wish record by using the rmdir control. At the immediate, kind rmdir want to remove the wish record.

Tip: If the record you're trying to remove contains any information or internet directories, you'll receive a mistake. To prevent this mistake use the /s option. For example, if the wish record still had the first.bat computer file you would need to kind rmdir /s wish at the immediate.