Windows Command Prompt can do lots of things. Here, we are going to discuss how to create and delete files using it.
Here we will also learn how to open and delete files using the command prompt. Let’s see how we can open the file.
Also Read: 7 Command Prompt Tricks that You Should Know
How to Open Files Using Command Prompt
Use can use command prompt to open any files with the default software. Say for example your text editor is notepad then when you open the file using the command prompt it will open in notepad.
Here the command:
Navigate to the directory and type the file_name_with_extension (note.txt)
To change drive use the drive name with a colon (E:) this will change the directory to E drive.
To change the directory use this command cd folder_name. For example:
Now to open the note.txt on the command prompt itself then use the command
You can also open images using Command prompt. Now say for example If want to view all the png file available in that directory then I will use
To open a file, use the following command
How to Delete Files Using Command Prompt
Here in this section, we are going to discuss how to delete files using command prompt.
Here is the command you can use to delete files:
How to Create Files Using Command Prompt
Here in this section, we are going to discuss how to create files using command prompt on windows 10. To create a file use echo command.
Say for example I want to create one text file (note.txt) with “Welcome to thecoderworld” content then I will use
echo Welcome to thecoderworld > note.txt
Now to add more content then use this command
echo Here we will learn how to use command prompt >> note.txt
Note: If you use a single greater than sign, it will override your file.