If you’ve either upgraded to Windows 10 from a previous Windows 7/8 installation, or simply started the Windows 10 upgrade process you may noticed two sizeable folders on the root of your system drive named:
- $Windows.~BT (ours was approx 10.3GB in size)
- $Windows.~WS (ours was approx 5.6GB in size)
These are hidden folders which are created by Windows during the Windows 10 upgrade process and can take up quite a chunk of valuable storage space, especially if you’re using an SSD which typically has significantly less overall storage space than a traditional mechanical drive; this particular machine had a 120GB SSD, so these two directories alone accounted for over 13% of the total storage capacity, which is massive. The $Windows.~WD directory alone was over 10GB:
Thankfully, both these folders are just temporary folders and can be safely removed at any time. We highly suggest however that you only delete these directories (along with the Windows.old folder) once you’re sure that your Windows 10 installation is working fine and you do not plan to restore or rollback your computer. If you try to restore/rollback after deleting these directories, you will receive an error message saying “We’re sorry, but you can’t go back. The files we need to take you back to a previous version of Windows were removed from this PC.”
How to remove via Disk Cleanup
The simplest way to remove this unnecessary data is via a useful built-in Windows tool called Disk Clean-up which has a very user-friendly graphical user interface (GUI). To remove these files using disk clean-up simply perform the following steps:
Search for “Disk Clean-up” and run the application as administrator.
Scroll down towards the bottom of the Disk Clean-up GUI and ensure you select Previous Windows installations(s):
In the above scenario, you can see that by clearing this alone we will free up 12GB of storage space.
Simple click OK and Disk Clean-up will automatically run and remove the data, which includes both the $Windows.~BT and $Windows.~WD directories.
How to remove manually
Before delving into the command prompt and utilizing what can be some very dangerous command line tools, you should first try removing the directories via Windows Explorer by viewing hidden files and folders and simply deleting them as this may work under certain circumstances. In our instance, we found we needed to take ownership and setup the required permissions before we could delete them, so to delete these directories we typed the following commands into an administrative command prompt one at a time:
takeown /F C:\$Windows.~BT\* /R /A
The takeown command enables an administrator to recover access to a file or folder that previously was denied, by making the administrator the owner of the file or folder.
- /F specifies the file name or directory name pattern. You can use the wildcard character * when specifying the pattern. You can also use the syntax ShareName\FileName.
- /R performs a recursive operation on all files in the specified directory and subdirectories.
- /A gives ownership to the Administrators group instead of the current user.
icacls C:\$Windows.~BT\*.* /T /grant administrators:F
The icacls command displays or modifies discretionary access control lists (DACLs) on specified files, and applies stored DACLs to files in specified directories.
- /T performs the operation on all specified files in the current directory and its subdirectories.
- /grant then grants the administrators group full access.
rmdir /S /Q C:\$Windows.~BT\
The rmdir command deletes a directory.
- /S deletes a directory tree (the specified directory and all its subdirectories, including all files).
- /Q specifies quiet mode which does not prompt for confirmation when deleting a directory tree. (Note that /q works only if /s is specified.)
These same three commands can then also be used to delete the second directory:
takeown /F C:\$Windows.~WS\* /R /A
icacls C:\$Windows.~WS\*.* /T /grant administrators:F
rmdir /S /Q C:\$Windows.~WS\
If everything works as anticipated you should see a successfully processed message at the end of command prompt with no failed files:
And that’s it. You’ll have now removed both unnecessary directories from your system drive and managed to claim back some vital storage space.
Note: If you get a message saying ““The system cannot find the file specified” it means the folder has already been deleted.
The aforementioned commands can actually be used to take ownership of, change the permissions of and delete any windows directory. So whilst for now you may just want to delete the two explicitly mentioned directories in this article, the same principals apply for removing any Windows directories.