{"id":11720,"date":"2012-09-12T03:34:00","date_gmt":"2012-09-12T07:34:00","guid":{"rendered":"<a href=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/hdd-image1.jpg\"><img class=\"alignnone size-full wp-image-11721\" src=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/hdd-image1.jpg\" alt=\"hdd-image\" width=\"176\" height=\"176\" \/><\/a>"},"modified":"2015-11-12T06:22:32","modified_gmt":"2015-11-12T11:22:32","slug":"how-to-clean-all-drives-with-a-single-click","status":"publish","type":"post","link":"https:\/\/davescomputertips.com\/how-to-clean-all-drives-with-a-single-click\/","title":{"rendered":"How To: Clean All Drives With A Single Click"},"content":{"rendered":"<div id=\"daves-1430536996\" class=\"daves-single-post-before-content daves-entity-placement\" style=\"margin-bottom: 25px;\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7205184075006101\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-7205184075006101\" \ndata-ad-slot=\"2700504761\" \ndata-ad-format=\"auto\" data-full-width-responsive=\"false\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div><p><a href=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/hdd-image1.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-11721\" src=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/hdd-image1.jpg\" alt=\"hdd-image\" width=\"176\" height=\"176\" srcset=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/hdd-image1.jpg 176w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/hdd-image1-150x150.jpg 150w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/hdd-image1-120x120.jpg 120w\" sizes=\"(max-width: 176px) 100vw, 176px\" \/><\/a><\/p>\n<h2>Clean all drives with a single click<\/h2>\n<p>The Disk Cleanup Tool that comes bundled with Windows Operating Systems works just fine to free up some disk space. You can use it to remove Temporary Files, Service Pack Backup Files, and a myriad of other clutter that eventually builds up over time. You can even remove all but the most recent System Restore Point.<\/p>\n<p>This is great if you have only a couple of hard drives and\/or partitions to deal with. My eccentric ways have resulted in my having 10 partitions spread over 4 physical drives. Wouldn&#8217;t it be nice to click one icon and all of them would magically be cleaned? Here&#8217;s how&#8230;<\/p>\n<h3>The Mysterious Command Box<\/h3>\n<p>Before we were spoiled with the GUI (pronounced &#8216;gooey&#8217; and stands for Graphical User Interface) we had DOS. That stands for Disk Operating System and is completely command-line driven. That means if you ever wanted your computer to do anything you had to type in an instruction, or command if you prefer. That was a far cry from the point and click interface we have all grown so familiar with.<\/p>\n<p>To set up a single-click hard drive clean all we will have to regress a bit. To open a Command Box in Windows 7 just use the <strong>Windows Key<\/strong> and tap the <strong>R<\/strong> key. In the window that opens type <strong>cmd<\/strong> and hit <strong>Enter<\/strong>. That should open a Command Box similar to this one. Your User Name may be be different.<\/p><div id=\"daves-4273044660\" class=\"daves-single-post-in-content daves-entity-placement\" style=\"margin-bottom: 25px;\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7205184075006101\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-7205184075006101\" \ndata-ad-slot=\"2700504761\" \ndata-ad-format=\"auto\" data-full-width-responsive=\"false\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p><a href=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cmd-box-image.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-11723\" src=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cmd-box-image.jpg\" alt=\"cmd-box-image\" width=\"549\" height=\"335\" srcset=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cmd-box-image.jpg 549w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cmd-box-image-150x91.jpg 150w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cmd-box-image-400x244.jpg 400w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><\/a><\/p>\n<p>By experimenting with this window you will realize that you can re-size it vertically but can not make it wider with your mouse. Let&#8217;s try a little hands-on command line writing. There is a command called &#8220;Mode&#8221;. The syntax for its use is: <strong>mode &lt;width&gt;, [&lt;height&gt;]<\/strong><\/p>\n<p>The square brackets indicate this parameter is optional. Try typing in a mode command like this and see what happens: <strong>mode 100<\/strong><\/p>\n<p>You must always hit the <strong>Enter<\/strong> key to invoke a command.<\/p>\n<ul>\n<li>Tip #1: The F3 key will insert your previously typed command<\/li>\n<li>Tip #2: The F7 key will offer you a list of your previously typed commands to choose from<\/li>\n<li>Tip #3: Right-clicking on the <strong>Title Bar<\/strong> and choosing <strong>Properties<\/strong> will offer a menu of options to choose from<\/li>\n<li>Tip #4: If you type Help you will be presented with a lengthy list of every command available<\/li>\n<li>Tip #5: If you type a command followed by <strong>\/?<\/strong>, as in &#8220;<strong>mode \/?<\/strong>&#8221; you will get help specific to that command<\/li>\n<\/ul>\n<h3>The Disk Clean Tool<\/h3>\n<p>In a typical scenario, to use the Disk Clean Tool you would go to the Properties sheet for your hard drive, then the Disk Cleanup Button. You will then be presented with several more options and mouse clicks to begin the operation. Then you will be treated to the joyous experience of some more clicks to get back out of the whole convoluted mess. This is totally unacceptable if you have more than a few drives to deal with.<\/p><div id=\"daves-3901492074\" class=\"daves-single-post-in-content-2 daves-entity-placement\" style=\"margin-bottom: 25px;\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7205184075006101\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-7205184075006101\" \ndata-ad-slot=\"2700504761\" \ndata-ad-format=\"auto\" data-full-width-responsive=\"false\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p>The command that we are interested in is called: <strong>cleanmgr <\/strong>Here are the command-line switches and syntax for this command:<\/p>\n<p><a href=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanmgr-usage-image.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-11725\" src=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanmgr-usage-image.jpg\" alt=\"cleanmgr-usage-image\" width=\"489\" height=\"169\" srcset=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanmgr-usage-image.jpg 489w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanmgr-usage-image-150x51.jpg 150w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanmgr-usage-image-400x138.jpg 400w\" sizes=\"(max-width: 489px) 100vw, 489px\" \/><\/a><\/p>\n<p>Command-line parameters are also called switches; that&#8217;s probably because they turn things on and off. Anyway, the switches we will be using are <strong>\/sagese<\/strong>t and <strong>\/sagerun<\/strong>. You will notice that each of these switches requires a parameter of its own. In each case it expects a number &#8211; indicated by the letter &#8216;<strong>n<\/strong>&#8216;. Pay attention to the colon between the switch and the number.<\/p>\n<p>Both of these switches will accept any number in the range of 0-65535 for a total of 65536 possible values. If you can think of a reason to set up that many different profiles you are a much more clever person than I. Fact is, I use only 1.<\/p>\n<h3>How It Works<\/h3>\n<p>This is what we&#8217;re going to do. First we&#8217;re going to tell Windows to set up a disk cleaning profile. We&#8217;ll do that with the <strong>\/sageset<\/strong> switch.<\/p><div id=\"daves-1310614759\" class=\"daves-single-post-in-content-3 daves-entity-placement\" style=\"margin-bottom: 25px;\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7205184075006101\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-7205184075006101\" \ndata-ad-slot=\"2700504761\" \ndata-ad-format=\"auto\" data-full-width-responsive=\"false\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p>Then we&#8217;re going to actually run that profile with the <strong>\/sagerun<\/strong> switch. Make sense?<\/p>\n<h4>Create your profile<\/h4>\n<p>In the Command Box type this: <strong>cleanmgr \/sageset:1<\/strong><\/p>\n<p>Remember to hit the Enter key after a command or you&#8217;ll be waiting for something to happen for a very long time. I chose number <strong>1<\/strong> for this exercise.<\/p>\n<ul>\n<li>Tip: Pay very close attention to all the spaces. The computer sees spaces as characters. Don&#8217;t ignore them. The computer doesn&#8217;t<\/li>\n<\/ul>\n<p>Once you hit Enter you will be shown a window like this:<\/p><div id=\"daves-2913826612\" class=\"daves-single-post-in-content-4 daves-entity-placement\" style=\"margin-bottom: 25px;\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7205184075006101\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-7205184075006101\" \ndata-ad-slot=\"2700504761\" \ndata-ad-format=\"auto\" data-full-width-responsive=\"false\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p><a href=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanup-options-image.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-11727\" src=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanup-options-image.png\" alt=\"cleanup-options-image\" width=\"389\" height=\"476\" srcset=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanup-options-image.png 389w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanup-options-image-122x150.png 122w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/cleanup-options-image-326x400.png 326w\" sizes=\"(max-width: 389px) 100vw, 389px\" \/><\/a><\/p>\n<p>Once you have checked\u00a0 the boxes and are happy with your choices click the OK button. It will seem as though nothing happened. But in the background Windows has made a record of your choices in a profile associated with the number you chose for the <strong>\/sageset<\/strong> switch. In our example that number was 1.<\/p>\n<h4>Run Your Profile<\/h4>\n<p>All you have to do now to run this profile is type this in the Command Box: <strong>cleanmgr \/sagerun:1<\/strong><\/p>\n<p>This may not seem like much of a time-saver. That would certainly be true if you had to go through these steps every time. Heck! You might have even been able to do it quicker the old-fashioned way. But here&#8217;s the trick&#8230;<\/p>\n<h4>Create a Batch File<\/h4>\n<p>Batch files are a seemingly forgotten but very powerful left-over from the DOS days. A Batch file is basically a text file in which you can type in a whole slew of commands to do a variety of things. The computer will read through this set of instructions, one line at time, and process those commands. Hence the name, Batch. They run a batch of commands all in one go.<\/p><div id=\"daves-2012010113\" class=\"daves-single-post-in-content-5 daves-entity-placement\" style=\"margin-bottom: 25px;\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7205184075006101\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-7205184075006101\" \ndata-ad-slot=\"2700504761\" \ndata-ad-format=\"auto\" data-full-width-responsive=\"false\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p>There are whole books dedicated to the subject of batch files. They can be incredibly flexible and useful tools and are worth a read if you&#8217;re interested in that type of thing.<\/p>\n<p>To create the Batch file simply open up Notepad. Do not use a word processor. We need pure text without any formatting instructions hidden in the background.<\/p>\n<p>In Notepad all you have to do now is type in the command you want Windows to process. In our case it is: <strong>cleanmgr \/sagerun:1<\/strong><\/p>\n<p><a href=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/edit-bat-image.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-11729\" src=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/edit-bat-image.jpg\" alt=\"edit-bat-image\" width=\"520\" height=\"215\" srcset=\"https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/edit-bat-image.jpg 520w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/edit-bat-image-150x62.jpg 150w, https:\/\/davescomputertips.com\/wp-content\/uploads\/2012\/09\/edit-bat-image-400x165.jpg 400w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/a><\/p>\n<p>Now, it&#8217;s important that you do not save this file as a text file. If you simply save it at this point Notepad will tack on the familiar <strong>.txt<\/strong> extension. We don&#8217;t want that. We want this file to have a <strong>.bat<\/strong> extension. Look in the Title Bar in the above image and you will see how it should look.<\/p>\n<p>Open the <strong>File Menu<\/strong> and choose <strong>Save As&#8230;<\/strong><\/p>\n<p>Give your new batch file a descriptive name. Something like Disk Clean All, for example. It can be anything you like. Now make sure to change the <strong>.txt<\/strong> extension to <strong>.bat<\/strong> (for batch). <strong>Note: Windows may complain about changing file extensions and how it may no longer work. Ah pooh &#8211; just say &#8220;Yes&#8221;.<\/strong><\/p>\n<p>You should now have a batch file that will run the <strong>cleanmgr<\/strong> command. You run it like you would any other program shortcut that you click. Then stand back and watch the magic happen.<\/p>\n<p>Congratulations! You have written a Batch File!<\/p>\n<ul>\n<li>Tip: If you need to change anything in your batch file just <strong>Right-click<\/strong> it and choose <strong>Edit<\/strong> from the context menu<\/li>\n<\/ul>\n<h3>Final Words<\/h3>\n<p>I hope this little tutorial has been helpful and that it will save you a whole bunch of time.<\/p>\n<p>Batch files are a powerful tool. You can write simple single-command ones like we just did, all the way up to complex menu systems and much more. There are many more commands available to batch files than are included in the Command Box. We haven&#8217;t even scratched the surface.<\/p>\n<div id=\"daves-1363773637\" class=\"daves-after-content daves-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7205184075006101\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-7205184075006101\" \ndata-ad-slot=\"3225321574\" \ndata-ad-format=\"autorelaxed\" data-full-width-responsive=\"false\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Clean all drives with a single click The Disk Cleanup Tool that comes bundled with Windows Operating Systems works just fine to free up some disk space. You can use it to remove Temporary Files, Service Pack Backup Files, and a myriad of other clutter [&hellip;]<\/p>\n","protected":false},"author":1373,"featured_media":11721,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[17,478],"tags":[223,111,1030,156,155],"class_list":["post-11720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how","category-microsoft-windows","tag-clean","tag-drives","tag-maintenance","tag-tips","tag-windows-7"],"_links":{"self":[{"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/posts\/11720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/users\/1373"}],"replies":[{"embeddable":true,"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/comments?post=11720"}],"version-history":[{"count":0,"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/posts\/11720\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/media\/11721"}],"wp:attachment":[{"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/media?parent=11720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/categories?post=11720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davescomputertips.com\/wp-json\/wp\/v2\/tags?post=11720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}