Sunday, June 28, 2009

Change owner and delete a system file in Windows Vista

Sometimes it is necessary to delete a file but impossible even with Administrator privileges because the file is owned by system itself. It is still can be done by 1) changing owner of the file and 2) granting full control over the file to the new owner.

For example, in order to delete C:\pagefile.sys (Pagefile should be already disabled in Control Panel\System\Advanced System Settings\Advanced\Performance Setting\Advanced\Change\No Paging File) start CMD elevated (Shft+Ctrl+Enter) then:

>takeown /f c:\pagefile.sys
>cacls c:\pagefile.sys /G username:F

Replace [username] with a real name of the user which took ownership of the file. After that the file should become deletable.

0 comments:

Post a Comment