{"id":331525,"date":"2021-08-27T17:00:00","date_gmt":"2021-08-27T14:00:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-delete-files-and-folders-using-command-prompt-on-windows-10\/"},"modified":"2021-08-27T17:00:00","modified_gmt":"2021-08-27T14:00:00","slug":"how-to-delete-files-and-folders-using-command-prompt-on-windows-10","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-delete-files-and-folders-using-command-prompt-on-windows-10\/","title":{"rendered":"#How to Delete Files and Folders Using Command Prompt on Windows 10"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3a9511ef119\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3a9511ef119\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-delete-files-and-folders-using-command-prompt-on-windows-10\/#Delete_Files_with_Command_Prompt_on_Windows_10\" >Delete Files with Command Prompt on Windows 10<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-delete-files-and-folders-using-command-prompt-on-windows-10\/#Delete_Folders_with_Command_Prompt_on_Windows_10\" >Delete Folders with Command Prompt on Windows 10<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-delete-files-and-folders-using-command-prompt-on-windows-10\/#Various_Uses_of_the_Del_Command\" >Various Uses of the Del Command<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Delete Files and Folders Using Command Prompt on Windows 10&#8221;<\/strong><\/p>\n<div>\n<!-- UNCACHED CONTENT --><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-738773\" srcset=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/Windows-10-logo-hero.png?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/Windows-10-logo-hero.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/Windows-10-logo-hero.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Windows 10 logo\" width=\"1200\" height=\"675\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you prefer command-line methods, Windows 10 offers a couple of commands to help you delete your files and folders from a Command Prompt window. We\u2019ll show you how to perform this deletion.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Delete_Files_with_Command_Prompt_on_Windows_10\"><\/span>Delete Files with Command Prompt on Windows 10<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.howtogeek.com\/72130\/learn-how-to-securely-delete-files-in-windows\/\">To delete files (not folders) from Command Prompt on Windows 10, you can use the built-in <code>del<\/code> command. This command helps you remove the specified files from your PC.<\/p>\n<blockquote class=\"admonishment_warning\"><p><strong>Warning:<\/strong> Know that the <code>del<\/code> command deletes the specified file without moving it to the Recycle Bin. This means you can\u2019t retrieve your file once it\u2019s been deleted.<\/p><\/blockquote>\n<p>To use it, first, open Command Prompt. Do this by opening the Start menu, searching for \u201cCommand Prompt\u201d, and clicking \u201cRun as Administrator\u201d on the right of the search results.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742227\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/1-open-command-prompt.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Select &quot;Run as administrator&quot; for Command Prompt in Windows 10's Start menu.\" width=\"650\" height=\"298\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>In the \u201cUser Account Control\u201d prompt that <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ears, click \u201cYes.\u201d<\/p>\n<p>You now have a Command Prompt window open. Here, type the following command, replacing <code>PATH<\/code> with the full path to the file you want to delete. Then press Enter.<\/p>\n<pre>del PATH<\/pre>\n<p>For example, to delete a file named \u201cMyFile.txt\u201d placed on your desktop, use the following command replacing <code>username<\/code> with your own username:<\/p>\n<pre>del \"C:UsersusernameDesktopMyFile.txt\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742228\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/2-delete-file-cmd.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Use the &quot;del&quot; command to delete a file from Command Prompt.\" width=\"650\" height=\"186\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>And your specified file is now deleted from your storage!<\/p>\n<p>To customize your deletion process, you can use a couple of parameters that the <code>del<\/code> command offers.<\/p>\n<p>For instance, you can add the <code>\/p<\/code> parameter to the command to get Command Prompt to ask for your confirmation before deleting a file. Similarly, you can add the <code>\/f<\/code> parameter to the command to force delete your read-only files.<\/p>\n<p>Here\u2019s what the above command looks like when paired with the <code>\/p<\/code> parameter:<\/p>\n<pre>del \/p \"C:UsersusernameDesktopMyFile.txt\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742229\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/3-delete-file-with-prompt-cmd.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Use the &quot;del \/p&quot; command to delete a file with a prompt from Command Prompt.\" width=\"650\" height=\"194\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Delete_Folders_with_Command_Prompt_on_Windows_10\"><\/span>Delete Folders with Command Prompt on Windows 10<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To delete folders (also called directories) on your PC, use Windows\u2019 built-in <code>rmdir<\/code> command. This command helps you delete folders as well as their subfolders and the files inside them.<\/p>\n<blockquote class=\"admonishment_warning\"><p><strong>Warning:<\/strong> Know that the <code>rmdir<\/code> command removes folders without moving them to the Recycle Bin. You can\u2019t restore your folders once they have been deleted with this command.<\/p><\/blockquote>\n<p>To use this command, open a Command Prompt window. Do this by opening the Start menu, searching for \u201cCommand Prompt\u201d, and clicking \u201cRun as Administrator\u201d on the right of the search results.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742227\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/1-open-command-prompt.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Select &quot;Run as administrator&quot; for Command Prompt in Windows 10's Start menu.\" width=\"650\" height=\"298\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>In the Command Prompt window that opens, type the following command replacing <code>PATH<\/code> with the full path to the folder you want to delete. Then press Enter.<\/p>\n<blockquote class=\"admonishment_note\"><p><strong>Note:<\/strong> Make sure that the folder you\u2019re deleting doesn\u2019t contain any files or folders. If the folder is not empty, use the second command given below to delete your folder.<\/p><\/blockquote>\n<pre>rmdir PATH<\/pre>\n<p>For example, to delete a folder named \u201cMyFolder\u201d on your desktop, use the following command replacing <code>username<\/code> with your own username:<\/p>\n<pre>rmdir \"C:UsersusernameDesktopMyFolder\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742230\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/4-delete-folder-cmd.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Use the &quot;rmdir&quot; command to delete a folder from Command Prompt.\" width=\"650\" height=\"192\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>And the command will get the specified folder removed from your PC!<\/p>\n<p>If the folder you want to delete contains any files or folders in it, add the <code>\/s<\/code> parameter to the command and this will remove your folder including all its subfolders and files within them.<\/p>\n<pre>rmdir \/s \"C:UsersusernameDesktopMyFolder\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742231\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/5-delete-folder-files-cmd.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Use the &quot;rmdir \/s&quot; command to delete a folder and all its subfolders and files from Command Prompt.\" width=\"650\" height=\"178\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>And that\u2019s all.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Various_Uses_of_the_Del_Command\"><\/span><a rel=\"nofollow noopener\" target=\"_blank\" name=\"moka_anchor_deluses\">Various Uses of the Del Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>With the <code>del<\/code> command, you can use your creativity to delete your files in various ways. For example, you can remove certain types of files, remove only the files that have a certain word in their names, and so on.<\/p>\n<p>For example, to delete all the PNG files in your current folder in Command Prompt, you can use the following command:<\/p>\n<blockquote class=\"admonishment_tip\"><p><strong>Tip:<\/strong> Feel free to replace \u201c.png\u201d with any file extension you want to delete.<\/p><\/blockquote>\n<pre>del *.png<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742232\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/6-del-certain-file-types.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Delete certain file types with the &quot;del&quot; command from Command Prompt.\" width=\"529\" height=\"174\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>This command selects all PNG files in the current folder and deletes them.<\/p>\n<p>Another creative use of the del command is to delete files that contain a certain word in their names. For example, to delete all files whose names start with \u201cword\u201d, you\u2019d use the following command:<\/p>\n<blockquote class=\"admonishment_tip\"><p><strong>Tip:<\/strong> Add the asterisk before the word to delete all files that end with your specified word.<\/p><\/blockquote>\n<pre>del \"word*\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742233\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/7-delete-files-starting-with-word.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Use the &quot;del&quot; command to delete files with certain words from Command Prompt.\" width=\"492\" height=\"172\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Finally, if you\u2019d like to remove all files from the current folder, use the following command:<\/p>\n<pre>del *.*<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-742234\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/8-delete-all-files.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Use the &quot;del&quot; command to delete all files in a folder from Command Prompt.\" width=\"463\" height=\"161\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>And that\u2019s how you delete files and folders with Command Prompt. Very handy!<\/p>\n<p>Deleting files with these methods is certainly not as intuitive as using the graphical methods, but it\u2019s good to have these methods just in case you need them.<\/p>\n<hr\/>\n<p>On a related note, did you know you can make Windows\u00a0<a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.howtogeek.com\/679976\/how-to-skip-the-recycle-bin-for-deleting-files-on-windows-10\/\">skip the Recycle Bin\u00a0while deleting files?<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>How to Skip the Recycle Bin for Deleting Files on Windows 10<\/em><\/strong><\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/742224\/how-to-delete-files-and-folders-using-command-prompt-on-windows-10\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Delete Files and Folders Using Command Prompt on Windows 10&#8221; If you prefer command-line methods, Windows 10 offers a couple of commands to help you delete your files and folders from a Command Prompt window. We\u2019ll show you how to perform this deletion. Delete Files with Command Prompt on Windows 10 To delete&#8230;<\/p>\n","protected":false},"author":1,"featured_media":331526,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/Windows-10-logo-hero.png?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-331525","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/331525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=331525"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/331525\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/331526"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=331525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=331525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=331525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}