How to Delete a System File in Windows 7
System files are important for any Operating system to work properly. If we deleted some of the system files then we need to repair the system using system repair disk in order to work with the system. If you need to delete a system file in Windows 7, even as an administrator account you cannot delete the system file. Windows 7 system files are protected using additional security mechanism to prevent from accidental deletion.The Files are with TrustedInstaller account
System files cannot be directly deleted from Windows 7, but we can delete or modify the system files by taking the ownership of the files and then you can delete the files.
How to take file Ownership in Windows 7
System files will be located in System and System32 folder under Windows folder. You can take the ownership of the system files by using command line utility or by using the wizard.
Now the file ownership is changed and you need to give full permission to the owner of the file.
How to Grant File Permission in Windows 7
Another method to take the ownership of the file is Windows 7 is using takeown command. Open the Windows command prompt and then type takeown command with /f option (using /f option you can specify the filename or directory) from the command prompt like below
takeown /f c:\mytest.txt
The above command will take the ownership of the mentioned file. In order to delete the file you need to have full control. Using cacls command we can give the full control to the file.
calcs c:\mytest.txt /G username:F
Now you can delete the file, otherwise the file might be in user restart and try it again. If you still can't delete the file then restart the machine login to system with safe mode and then delete the file.