How to delete old pagefile.sys and hiberfile.sys on secondary disk (old windows install)

The files are protected using NTFS ACLs. Use takeown to take ownership of them.


Combining the answers it's quite simple, no external programs needed.

From a dos prompt: icacls hiberfil.sys /grant everyone:f to get access to the file attrib -h -s hiberfil.sys to make it visible for deletion del hiberfil.sys to delete the file

For pagefile.sys it works the same way.


Use unlocker to do this. It can not only remove the locking handles that are giving you an "access is denied" message, but can also delete the files at the same time (in case the program tries to reacquire the handle).