How to Delete The Windows.old Folder Using Command Prompt

Delete Windows old FolderDelete Windows old Folder

Windows.old folder is created when you upgrade your Windows operating system to a new version. It contains a copy of your previous Windows installation if you want to restore or restore the OS. This includes all system files but excludes any temporary files.

For example, when I upgraded from Windows 10 Version 22H2 to Windows 11, the system created a Windows.old folder for me automatically. Normally, a user only has 10 days to decide whether they want to downgrade to the previous version of Windows or continue with the current upgrade. After 10 days, the system automatically deletes the Windows.old folder. 

For some reason, if the system doesn’t delete the Windows.old folder, you will need to delete it manually, as it keeps taking up valuable space in the hard drive. It takes around 25GB of disk space and is located at the root of your OS partition (C drive).

However, you can remove the Windows.old folder in Windows using Disk Cleanup and free up space using the Disk Cleanup tool. Sometimes it also fails to delete the folder. Although it is safe to delete the Windows.old folder after 10 days, you can’t delete the Windows.old folder just by pressing the Del key or selecting Delete from the context menu.

Delete Windows.old folder

To remove temporary files and free up space on Windows 11, follow these steps:

  1. Press the Windows logo key on your keyboard

    Open Start Menu Settings
    Open Start Menu Settings
  2. Click on Settings

    Open Start Menu Settings
    Open Start Menu Settings
  3. Select System

    Open System Storage from Settings
    Open System Storage from Settings
  4. Choose Storage

    Open System Storage from Settings
    Open System Storage from Settings
  5. Click on Temporary files

    Temporary files in Storage Settings
    Temporary files in Storage Settings
  6. Tick the box for “Temporary Windows installation files

    Temporary Windows installation files
    Temporary Windows installation files
  7. Click on “Remove files” to delete them.

    Remove Temporary files in Windows 11
    Remove Temporary files in Windows 11

We can also manually delete the Windows.old folder using the Command Prompt.

Delete Windows.old Folder using Command Line

To delete the Windows.old folder in Windows 11, open the command prompt window and enter the command “RD /S /Q %SystemDrive%\windows.old“, followed by pressing the Enter key. This will remove the Windows.old folder without any issues.

Sometimes, the system will not let you delete the folder directly, because you don’t have ownership rights on the folder. To do this, we will need to take ownership of the folder, change its permissions, and then delete the folder. The next steps document this process.

Here are the steps to remove the Windows.old folder using Command Prompt:

  1. Open Command Prompt with administrative privileges.

  2. Run the following command:

    takeown /F C:\Windows.old\* /R /A
    Take ownership of content inside Windows old folder
    Take ownership of content inside Windows old folder

    This command will take ownership of the Windows.old folder and all its contents. The /F switch is used to specify the folder path. /R will take ownership of all sub-folders and files inside the main folder recursively. /A switch will give ownership to the Administrators group instead of the current user.

  3. Now run the following command:

    cacls C:\Windows.old\. /T /grant administrators:F
    Give full permission to Administrator group for Windows old folder
    Give full permission to Administrator group for Windows old folder

    cacls command will set the access control list (ACL permissions) for the specified folder. The /T switch will run the command recursively for all sub-folders and files. /grant administrators:F will grant full permissions to the Administrators group.

  4. Now run the following command:

    rmdir /S /Q C:\Windows.old\
    Delete the Windows old folder from Command Prompt
    Delete the Windows old folder from Command Prompt

    Finally, this command will delete the Windows.old directory and all its contents. /Q switch will ensure the files are deleted in “quiet” mode. Please note that since it’s in quiet mode, it will take some time but will not show any progress on the Command Prompt. Please be patient and do not close the window until the command finishes processing.

Conclusion

Windows.old is a very useful feature from Microsoft that can help restore the OS to an earlier version of Windows in case we need it. But sometimes, when this folder is not deleted by the system properly, it takes up quite a bit of disk space. The commands in this guide will help you easily delete the folder manually.

Here’s how you can roll back to the previous build of Windows. This should be performed within the next 10 days after the upgrade. Otherwise, you will need to apply another trick to keep the Windows.old folder and restore the OS after 10 days.

To save further space from Windows Update, you should run the following commands to clean up system space after the Windows Update.

DISM.exe /Online /Cleanup-Image /AnalyzeComponentStore
DISM.exe /Online /Cleanup-Image /StartComponentCleanup
Perform cleanup after Windows update
Perform cleanup after Windows update
If you liked this post, Share it on:
Usman Khurshid is a seasoned IT Pro with over 15 years of experience in the IT industry. He has experience in everything from IT support, helpdesk, sysadmin, network admin, and cloud computing. He is also certified in Microsoft Technologies (MCTS and MCSA) and also Cisco Certified Professional in Routing and Switching.

Get Updates in Your Inbox

Sign up for the regular updates and be the first to know about the latest tech information