• About
  • Contact
  • Cookie
  • Disclaimer
  • Privacy Policy
  • Change the purpose of use

Tnhelearning.edu.vn - Various useful general information portal

  • Photo
  • Bio
  • How To
  • Tech

How to Delete Files Using Command Prompt

February 20, 2024 by admin Category: How To

You are viewing the article How to Delete Files Using Command Prompt  at Tnhelearning.edu.vn you can quickly access the necessary information in the table of contents of the article below.

X

This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.

The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.

This article has been viewed 14,837 times.

This is an article that shows you how to delete files on your computer using commands in Command Prompt.

Table of Contents

  • Steps
    • Prepare before deleting files
    • Delete files using Command Prompt
  • Advice
  • Warning

Steps

Prepare before deleting files

Image titled Delete a File Using Command Prompt Step 1

Image titled Delete a File Using Command Prompt Step 1

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/f/f9/Delete-a-File-Using-Command-Prompt-Step-1-Version-2.jpg/v4-728px- Delete-a-File-Using-Command-Prompt-Step-1-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/f/f9/Delete-a- File-Using-Command-Prompt-Step-1-Version-2.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-1-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:344,”bigWidth”:728,”bigHeight”:544,”licensing”:”<div class=”mw-parser-output”></div>”}
Find files. If you know where the file is saved, just open the folder where the file is located. For example, if you want to delete an image or text file, you’ll find the default “Documents” folder – usually where the above file type is stored.

  • If you don’t know where the file is saved, enter the file name in the Start search bar, then right click on the file when you see it displayed, continue to click Open file location . to be taken directly to the file location.
Image titled Delete a File Using Command Prompt Step 2

Image titled Delete a File Using Command Prompt Step 2

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/2/25/Delete-a-File-Using-Command-Prompt-Step-2-Version-2.jpg/v4-728px- Delete-a-File-Using-Command-Prompt-Step-2-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/2/25/Delete-a- File-Using-Command-Prompt-Step-2-Version-2.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-2-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:344,”bigWidth”:728,”bigHeight”:544,”licensing”:”<div class=”mw-parser-output”></div>”}
Click and drag the file to the desktop. This will make the file deletion process easier because you don’t have to rename the folder containing the file to be deleted in the Command Prompt.

  • The only exception to this rule is when you try to delete files from the “System32” folder – the Windows system files folder. In this case, you will not move the file.
READ More:   How to Shutdown Remote Desktop in LAN
Image titled Delete a File Using Command Prompt Step 3

Image titled Delete a File Using Command Prompt Step 3

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/8/88/Delete-a-File-Using-Command-Prompt-Step-3-Version-2.jpg/v4-728px- Delete-a-File-Using-Command-Prompt-Step-3-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/8/88/Delete-a- File-Using-Command-Prompt-Step-3-Version-2.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-3-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Right click on the file. You will see a list of options appear on the screen.
Image titled Delete a File Using Command Prompt Step 4

Image titled Delete a File Using Command Prompt Step 4

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/7/7d/Delete-a-File-Using-Command-Prompt-Step-4-Version-2.jpg/v4-728px- Delete-a-File-Using-Command-Prompt-Step-4-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/7/7d/Delete-a- File-Using-Command-Prompt-Step-4-Version-2.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-4-Version-2.jpg”,”smallWidth”:460 ,”smallHeight”:343,”bigWidth”:728,”bigHeight”:543,”licensing”:”<div class=”mw-parser-output”></div>”}
Click Properties at the bottom of the displayed menu.
Image titled Delete a File Using Command Prompt Step 5

Image titled Delete a File Using Command Prompt Step 5

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/d/d1/Delete-a-File-Using-Command-Prompt-Step-5.jpg/v4-728px-Delete-a- File-Using-Command-Prompt-Step-5.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/d/d1/Delete-a-File-Using-Command-Prompt- Step-5.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-5.jpg”,”smallWidth”:460,”smallHeight”:347,”bigWidth”:728,”bigHeight” :549,”licensing”:”<div class=”mw-parser-output”></div>”}
See the file extension. File extensions appear near the top of the “General” tab in the “Properties” window, to the right of the “Type of file:” line. You need to know the file extension to be able to delete it in the Command Prompt. Here are a few familiar extensions:

  • .txt – Text file (created in Notepad).
  • .docx – Microsoft Word file.
  • .jpg or .png – Image file.
  • .mov, .wmv, .mp4 – Video file.
  • .mp3, .wav – Audio file.
  • .exe – An executable file (such as an installation file).
  • .lnk – Shortcut file. Deleting a program’s shortcut will not remove the program from your computer.
Image titled Delete a File Using Command Prompt Step 6

Image titled Delete a File Using Command Prompt Step 6

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/a/a5/Delete-a-File-Using-Command-Prompt-Step-6.jpg/v4-728px-Delete-a- File-Using-Command-Prompt-Step-6.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/a/a5/Delete-a-File-Using-Command-Prompt- Step-6.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-6.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Rewrite the extension. Once you know the extension, you’re ready to open and use the Command Prompt.

Delete files using Command Prompt

Image titled Delete a File Using Command Prompt Step 7

Image titled Delete a File Using Command Prompt Step 7

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/1/1a/Delete-a-File-Using-Command-Prompt-Step-7.jpg/v4-728px-Delete-a- File-Using-Command-Prompt-Step-7.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/1/1a/Delete-a-File-Using-Command-Prompt- Step-7.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-7.jpg”,”smallWidth”:460,”smallHeight”:347,”bigWidth”:728,”bigHeight” :549,”licensing”:”<div class=”mw-parser-output”></div>”}
Open Command Prompt. In this case, you need to avoid using the “Administrator” version of the Command Prompt, unless you want to delete files in the “System32” folder. You can open Command Prompt in many ways depending on the Windows operating system you are using:

  • Hold down the ⊞ Win key and press X , then click Command Prompt above the Start button.
  • Right-click the Start button in the lower-left corner of the screen, then click Command Prompt in the currently displayed window.
  • Type “Command Prompt” into the Start menu search bar (for Windows 8, you’ll move your mouse pointer to the upper-right corner of the screen and click the magnifying glass icon), and then click the “Command” icon. prompt” when you see it appear on the screen.
  • Open the “Run” application from the Start menu, then type “cmd” and click OK .
READ More:   How to Draw Sharks
Image titled Delete a File Using Command Prompt Step 8

Image titled Delete a File Using Command Prompt Step 8

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/9/93/Delete-a-File-Using-Command-Prompt-Step-8.jpg/v4-728px-Delete-a- File-Using-Command-Prompt-Step-8.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/9/93/Delete-a-File-Using-Command-Prompt- Step-8.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-8.jpg”,”smallWidth”:460,”smallHeight”:348,”bigWidth”:728,”bigHeight” :551,”licensing”:”<div class=”mw-parser-output”></div>”}
Type cd desktop and press ↵ Enter . This will change the location (or “directory”) in the Command Prompt to the desktop folder.

  • You can do many other ways to change the folder name in Command Prompt if needed.
  • Opening the Command Prompt in “Administrator” mode will change the directory to the “System32” file. Therefore, you should not open Command Prompt in “Administrator” mode unless your file is stored in the “System32” folder.
Image titled Delete a File Using Command Prompt Step 9

Image titled Delete a File Using Command Prompt Step 9

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/f/f9/Delete-a-File-Using-Command-Prompt-Step-9-Version-3.jpg/v4-728px- Delete-a-File-Using-Command-Prompt-Step-9-Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/f/f9/Delete-a- File-Using-Command-Prompt-Step-9-Version-3.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-9-Version-3.jpg”,”smallWidth”:460 ,”smallHeight”:349,”bigWidth”:728,”bigHeight”:553,”licensing”:”<div class=”mw-parser-output”></div>”}
Type del [filename.filetype] . Replace “filename.filetype” with the name and extension of the file you want to delete.

  • For example, if the image file is named “icecream”, you would enter the command icecream.png ; if the text file is named “notes”, your command will be notes.txt .
  • For filenames with spaces, you would enclose the filename in quotes: "I like turtles.jpg" instead of I_like_turtles.jpg .
  • To delete all files with the same extension on your desktop (such as all text files), you would enter *.filetype with “filetype” as the file’s extension (for example, * .txt ).
  • Image titled Delete a File Using Command Prompt Step 10

    Image titled Delete a File Using Command Prompt Step 10

    {“smallUrl”:”https://www.wikihow.com/images_en/thumb/9/92/Delete-a-File-Using-Command-Prompt-Step-10.jpg/v4-728px-Delete-a- File-Using-Command-Prompt-Step-10.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/9/92/Delete-a-File-Using-Command-Prompt- Step-10.jpg/v4-728px-Delete-a-File-Using-Command-Prompt-Step-10.jpg”,”smallWidth”:460,”smallHeight”:348,”bigWidth”:728,”bigHeight” :550,”licensing”:”<div class=”mw-parser-output”></div>”}
    Press ↵ Enter . You should see a new line in the Command Prompt. Now your file is deleted.

    • Since the “del” command directly deletes the file from the hard drive, you don’t need to delete the file in the recycle bin again.
  • Advice

    • You should use your system’s file manager to delete files, and only use the Command Prompt when deleting files requires more aggressive action.

    Warning

    • If you delete even a single system file, the computer may stop working.
    • Using Command Prompt to delete files will not move the file to the recycle bin.
    READ More:   How to Get rid of Asian Ladybugs
    X

    This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.

    The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.

    This article has been viewed 14,837 times.

    This is an article that shows you how to delete files on your computer using commands in Command Prompt.

    Thank you for reading this post How to Delete Files Using Command Prompt at Tnhelearning.edu.vn You can comment, see more related articles below and hope to help you with interesting information.

    Related Search:

    Related Posts

    How to Create Curved Text in Photoshop
    How to fall asleep faster
    How to Install FBReader to Read eBooks

    Category: How To

    Previous Post: « The Best Ways to Absorb Calcium Supplements
    Next Post: How to Download Music from YouTube »

    Copyright © 2025 · Tnhelearning.edu.vn - Useful Knowledge