Remove the Windows.old folder manually

Martin Brinkmann
Jul 12, 2017
Windows, Windows tips
|
40

Windows creates the folder Windows.old on a PC running Windows when you upgrade the PC to a new version of the operating system.

The Windows.old folder contains files and folders of the old installation of Windows, and the main reason it is there is that it is used to restore the old system if the user wants to go back to it.

This folder may take up a sizeable amount of space, but will get deleted automatically usually by Windows after a set period of time.

Windows users may also use the disk cleanup tool to remove the folder as described here. Sometimes however it happens that the folder and its content is not removed, and that a manual removal does not work either.

When you try to delete the folder manually in Explorer, you get permission errors as the folder is associated with SYSTEM and not a user or administrator account.

What happens usually is that you get a permission request first to run the operation with administrative privileges, and then the Folder Access Denied error.

Remove the Windows.old folder manually

You need to run the following commands remove the Windows.old folder manually.

  1. Open an elevated command prompt. EAsiest way to do so is to tap on Windows, type cmd.exe, hold down the Shift-key and the Ctrl-key, and launch the elevated command prompt with a tap on the Enter-key.
  2. takeown /F c:\Windows.old\* /R /A /D Y
  3. cacls c:\Windows.old\*.* /T /grant administrators:F
  4. rmdir /S /Q c:\Windows.old

Lets take a closer look at the commands to better understand what they do:

takeown /f c:\Windows.old\* /r /a /d y

Takeown can be used to make the administrators group the owner of a file or directory.

  • /f c:\Windows.old\* -- This specifies the location and files that the operation will be run on.
  • -r -- performs a recursive operation on all files (means all files are included that are in the Windows.old folder).
  • -a -- gives ownership to the Administrators group.
  • -d Y -- surpresses the confirmation prompt when the current user does not have the "List Folder" permission.

cacls c:\Windows.old\*.* /t /grant administrators:f

This command displays or modifies DACL (discretionary access control list) files.

  • c:\Windows.old\*.* -- The files you want the operation to run on.
  • /t -- This changes the DACL of the files in the selected directory and all subdirectories.
  • /grant administrators:f -- This grants full access rights to the administrators group (The F stands for full)

rmdir /s /q c:\Windows.old

The command removes a directory.

  • /s -- this parameter makes the command remove the directory that is specified, and all of its subdirectories and files.
  • /q -- runs the program in quiet mode without confirmation prompts.
  • c:\Windows.old -- specifies the directory the operation should be run on.

Resources:

Summary
Article Name
Remove the Windows.old folder manually
Description
This guide provides you with detailed instructions on deleting the Windows.old folder on a Windows computer manually and forcefully.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Anonymous said on December 19, 2023 at 10:48 am
    Reply

    Nothing else worked, including manually taking ownership, system tools, etc., but this did the trick. Thank you for your service.

  2. Jibun no Kage said on May 8, 2023 at 7:20 pm
    Reply

    Does not work, take ownership runs but is incomplete, but cacls fails with multiple access denied even after ownership take. Yes, ran CLI in CMD as administrator, and using administrator account. Thus rmdir fails badly since ownership and cacls both fail. So as of the date of this comment, your solutions fails.

  3. Adrian Lincoln said on March 23, 2022 at 2:49 pm
    Reply

    Brilliant – just what I was needed. For some inexplicable reason the usual windows10 cleanup utility of temporary files didn’t have an option to remove the previous install. (why not ???). Many thanks.

  4. Anonymous said on October 14, 2021 at 8:56 pm
    Reply

    Hmmm. Copied the text into a batch file and ran it… and promptly toasted the computer. If copied directly from the web page, there are spaces in the command which affect how it runs. Before I could do anything, many directories were obliterated. Fortunately, it was a test machine and I could afford to lose that stuff, but still have to rebuild that system from scratch.

  5. Anonymous said on February 24, 2021 at 5:54 pm
    Reply

    i get a bunch of errors in feedback on the first cmd, and access denied when i run the second or third…

  6. Anonymous said on November 15, 2020 at 5:24 pm
    Reply

    Old thread but wanted to say thanks, the folder was renamed during the win10 upgrade and the system wouldn’t do it automatically. Great advice, worked perfectly and freed up 15G!

  7. Suzanne said on November 6, 2020 at 11:42 pm
    Reply

    THANK YOU! I don’t know why everyone thinks that disk cleanup will ALWAYS work. I never had an option to remove the previous version of windows. You made my day!

  8. JOey said on July 14, 2020 at 1:49 pm
    Reply

    THANK YOU SOO MUCH SAVED ME 20GB been looking for this , the app unlocker takes ages to delete 100mb

  9. Charlie said on April 25, 2020 at 4:50 pm
    Reply

    Excellent!
    had to run it twice, but it did the trick

  10. Charles said on March 23, 2020 at 4:35 am
    Reply

    Disk cleanup doesn’t see the Windows.old folder in many cases. This article was a lifesaver, thank you!

  11. PattyPP said on February 27, 2020 at 2:57 pm
    Reply

    Good God.

    Why would you want to memorize all those long and dangerous commands?

    Just use Windows “disk cleanup” and click the checkbox.

    Ugh.

  12. Woody Glendell said on January 27, 2020 at 5:37 pm
    Reply

    This WORKED!!!! THANK YOU! THANK YOU! THANK YOU!

  13. Costa said on January 12, 2020 at 3:37 pm
    Reply

    The execution of the 2 cmd

    “cacls C:\Windows.old\*.* /T /grant administrators:F”

    stops after a while with the error:

    “the data area path to a system call is too small”

    What do i do?

    1. Anonymous said on January 28, 2020 at 7:37 pm
      Reply

      Costa are you doing this from a command prompt or from powershell? I had a similar error in Powershell but it worked just fine in command prompt.

  14. R. Haukom said on November 13, 2019 at 5:41 pm
    Reply

    Dear Ghacks.net Administrator: Please note that in the command sequence noted above (takeown /F c:\Windows.old\* /R /A /D Y) to manually remove Windows.old directory and its contents has a typographical error… the command shown om example 2. is “takeown /F c:\Windows.old\* /R /A /D Y”. Tried this and it was not successful in changing the ownership conditions of any files in the target directory. On examination of the explanation text below the suggested commands, I noted that the trailing command switches to the command should have a dash (-) preceding the command switches instead of the slash (/) as shown in the example. I retried the takeown command with the following changes…”takeown /F c:\Windows.old\* -R -A -D Y” which was successful in changing the ownership conditions on all files in the Windows.old directories. The following commands shown in example 3. and 4. were successful as well.
    I know you strive for excellence in your advice to your readers. Please try to update the information I have noted above. Sincerely, RDH, an appreciative reader

    1. SillyOldDude said on November 24, 2020 at 9:12 pm
      Reply

      Thank you RDH. “takeown /F c:\Windows.old\* -R -A -D Y” worked for me. Thanks.

  15. Sebastian42 said on October 14, 2019 at 6:47 am
    Reply

    Although no files show in Explorer, the excuse given for not deleting is ‘folder not empty’ – that was BEFORE your code and still after your code.

  16. Jim Potyoposin said on September 15, 2019 at 6:15 pm
    Reply

    access denied
    you are irrelevant don’t write things and confuse us

  17. Anonymous said on June 11, 2019 at 5:58 pm
    Reply

    Great worked great for me

  18. Arcionquad said on November 30, 2018 at 3:23 pm
    Reply

    It worked!

    Thanks.

  19. Michael Wallace said on November 28, 2018 at 7:35 am
    Reply

    _____THANK_____YOU !!!!!!!!!!!!!!!!!!!!!

    I wrestled with this for about an hour. Cortana would not give up the ghost.

    I rebooted into safe mode, and applied your fix, and WINDOWS.OLD is now GONE !!!!!

  20. Steve W said on October 1, 2018 at 4:25 am
    Reply

    Thank you! This worked perfectly where windows.old would not remove through all other methods.

  21. Fame said on July 15, 2018 at 8:35 pm
    Reply

    Thank you
    Worked like a charm. Keep up the good work

  22. Lo Ha said on July 16, 2017 at 6:49 pm
    Reply

    “Zuordnungen von Kontennamen und Sicherheitskennungen wurden nicht durchgeführt”
    Meaning: “Assignments of accounts and security-states are Not altered.”

  23. Lo Ha said on July 16, 2017 at 6:43 pm
    Reply

    “Zuordnungen von Kontennamen und Sicherheitskennungen wurden nicht durchgeführt ”
    Meaning:”Assignments of accounts and security-states are Not altered.”

  24. chesscanoe said on July 16, 2017 at 11:54 am
    Reply

    I used Google to search the German phrase and translate the result to English. Perhaps https://community.norton.com/de/forums/zuordnungen-von-kontennamen-und-sicherheitskennungen-wurden-nicht-durchgef%C3%BChrt-vista-32-gho-0 will help from Norton.

  25. Lo Hanisch said on July 15, 2017 at 9:52 pm
    Reply

    LoHa

    command 2 answered:”Zuordnungen von Kontennamen und Sicherheitskennungen wurden nicht durchgeführt.”
    What to do?

    aloha

  26. TianlanSha said on July 13, 2017 at 3:23 pm
    Reply

    I’ve seen another method where you run Disc Cleanup and it deletes it.

    1. Martin Brinkmann said on July 13, 2017 at 4:24 pm
      Reply

      Yes, Disk Cleanup deletes it usually, but there are situations where this won’t work, or where leftovers remain.

      1. Rasthro said on January 23, 2022 at 10:16 am
        Reply

        When i typed: rmdir /S /Q c:\Windows.old
        Only access is denied error shows up even if the takedown command worked how come nothing works for me while it works for everybody else,

      2. Mark Hazard said on July 13, 2017 at 8:11 pm
        Reply

        Yes, disk cleanup deleted the files but not the folder. When I tried to delete the folder manually, I got the response that the file was corrupted and unreadable. I searched the Web for an answer, which was to use Chkdsk. When I did that, I was told that the file was in use by another program(?). I was asked if I wanted to run Chkdsk on the the next restart. I answered yes, and restarted. Chkdsk worked seemingly very quickly, and when I tried to delete Windows.Old, I got the same response. I repeated the process, and this time Chkdsk worked more slowly. Then I was finally able to delete Windows.Old.

        The Chkdsk command that I used from an administration account was chkdsk C: /F. I tried another version using /B but it did not work. This was on Windows 8.1.

  27. Arie said on July 13, 2017 at 8:16 am
    Reply

    Boot from a Linux live cd / dvd, go te the folder where windows.old is located, delete it, done

  28. jasray said on July 12, 2017 at 9:21 pm
    Reply

    Bastante para ahora–

    takeown /F C:\Windows.old\* /R /A
    pause
    cacls C:\Windows.old\*.* /T /grant administrators:F
    pause
    rmdir /S /Q C:\Windows.old\
    pause

    Copy-paste this in Notepad and save it as a .bat file.

    1. mamatkroghr said on February 6, 2022 at 11:24 pm
      Reply

      thank bro..

    2. Yoyoyo said on July 22, 2021 at 10:12 am
      Reply

      Thank you, it worked perfectly! It saved me 15GB on my tiny SSD Woop woop! I hope you have a good day sir :D

    3. Rentadanny said on October 18, 2020 at 5:32 pm
      Reply

      Thank you Sir.

    4. Bearman_18 said on September 11, 2019 at 10:33 pm
      Reply

      This guy is a friggin’ hero.

    5. Josh said on June 21, 2019 at 6:16 pm
      Reply

      Awesome, love it!

    6. Ephos said on November 21, 2018 at 9:07 am
      Reply

      worked well for me thanks @ jasray

  29. dmacleo said on July 12, 2017 at 8:50 pm
    Reply

    if on domain may work bit different, can rt click folder properties-security-advanced-change permissions.
    then where it lists owner click change and use domain admin acct.
    click the replace all child object box.
    then apply, ec then delete.
    have had to do it to 15 or so of them lately..

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.