Delete the Windows.old folder from a server

When performing an in place upgrade of your server, you are left with a folder called windows.old which you are unable to delete, even if you take ownership of it.

Whereas in a client version of windows, you can remove this using the disk cleanup tool, this is not possible on Windows Server.

For this you will need to follow the below procedure.

From the start menu, type CMD into the search facility or run box, and then right click on it and “run as administrator”.

Type the following at the command prompt, type the following and run then in sequence:

takeown /F <DriveLetter>:\<FolderName>\* /R /A

cacls <DriveLetter>:\<FolderName>\*.* /T /grant administrators:F

rmdir /S /Q  <DriveLetter>:\<FolderName>\

2 comments

  1. Ricardo says:

    It work pretty good but i tried another thing.
    1º open a cmd elevated
    2º run psexec -i -s %comspec% > it will open a cmd with user system (Pstools is needed to do that)
    3º create a empty folder “New folder” > “C:\new folder”
    4º robocopy “c:\new folder” c:\windows.old /purge
    5º be happy

  2. Brian Jones says:

    Thanks, I will give it a try when I get the opportunity

Leave a Reply

%d bloggers like this: