Delete WINDOWS.OLD on Windows Server

Posted: October 5, 2014 in Information, Server 2012, Windows General
Tags: , , ,

After performing an in-place upgrade on a Windows machine, you will find a WINDOWS.OLD folder in the root of C:. This folder will have a backup of your old program files, appdata and Windows folder… just in case you need to revert back or recover something that might have been lost during the upgrade. When you try to delete it though you are told you don’t have permissions. Just a small point here, it is generally not recommended to do in-place upgrades on servers. In fact there are some products (e.g. Exchange, ConfigMgr) that explicitly state they do not support upgrading the Operating System. There is of course a difference between “what works” and “what is supported”, but I do suggest where possible you do a clean Server install and migrate your application to the new server. Anyway, let’s assume you’ve understand all the risks and have done a successful in-place upgrade, you now find the old WINDOWS.OLD folder of several GB in size sitting there. If all is well, then you might as well just delete it.

SOLUTION

On Desktop OS version, you can just use the disk cleanup tool to remove it, but that is not available (by default) on Servers, so there are a couple of approaches.

1. Command line tools to take ownership and delete the folder (as per: http://windowsitpro.com/windows-server-2012/remove-windowsold-server). Make sure to “run as administrator”

takeown /F c:\Windows.old\* /R /A /D Y 
cacls c:\Windows.old\*.* /T /grant administrators:F
rmdir /S /Q c:\Windows.old

2. Or you can add the “Desktop” features to provide the Disk Cleanup tool: http://social.technet.microsoft.com/wiki/contents/articles/15221.enabling-disk-cleanup-utility-in-windows-server-2012.aspx

Personally, the command line option is less messy and saves having to add features to your server that don’t really need to be there.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s