Click on the start screen of your computer and go to the search box. Type command prompt or cmd. Double click on Command Prompt from the list of results to open the command prompt. The command prompt will look like this: C:\users\Username>.;
, Use the mkdir command to create a new directory to work with. The command is mkdir -> directory name. In the example above, a new directory called wikihow was created by typing: mkdir wikihow.
 In order to move into the newly created directory, use the cd or change directory command. The command is cd -> directory name. In the example, cd wikihow was typed. Now the prompt looks like this: C:\users\Brian\wikihow> as shown above.
 In order to check the contents of the current directory, use the dir command. Simply type dir and press enter and a list of the directory contents will be displayed as shown. In the example the wikihow directory is currently empty.
 To clear the screen, use the cls command. Simply type cls and press enter to clear all of the contents of the screen. Only the command prompt will remain on the screen as shown above.
 In order to create a new file, use the type NUL > command. Type: type NUL> filename and press enter to create a new empty file. In the example above, type NUL> newfile was typed.
 Now repeat step 5 to create a second new file. Call this file newFile1. The new command is: type NUL> newFile1.
 Now check the directory contents using the dir command. The wikihow directory now contains two new files called newFile and newFile1 as shown above.
 To delete files, use the del command. Type del -> filename to delete a specific file. In this example, delete newFile using the following command: del newFile. Now, check the wikihow directory contents you can see that newFile has been deleted. Clear the screen using the cls command.
 In order to complete the next step, deleting a directory, first, leave the current working directory. To do this, use a version of the change directory command. Use the cd.. command to move into the parent directory without typing the directory name. In the example, type: cd.. as shown above. Notice the prompt is now back to C:\users\Brian> which means that this is no longer in the wikihow directory.
 To delete a directory, use the rmdir command. You can't be in the directory that you want to delete (see step 10 above). If the directory is empty, meaning it does not contain any files, you can delete it by simply typing rmdir -> directory name. In this example the wikihow directory still contains newFile1 so the rmdir command will not work in this case. If the directory is not empty you will receive an error message as shown above.
 To remove a directory that contains files, use a modified version of the rmdir command. Use the rmdir /s command. In the example, type: rmdir /s wikihow and press the enter key. You will be prompted to confirm that you want to delete the directory by typing Y/N. Type Y for yes or N for no as shown above. When you type Y the entire directory and all of its contents are deleted from the system.
Open the Windows Command Prompt.
Create a new directory.
Change the current working directory.
Check the directory contents.
Clear the screen.
Create a new file.
Add another new file.
Check directory contents.
Delete files.
Move into parent directory.
Remove/delete an empty directory.
Remove a directory that contains files.
{"src": "wikihow-all_test", "title": "How to Create and Delete Files and Directories from Windows Command Prompt"}