Windows File Access Denied

Use Unlocker to unlock those files and then try to do whatever you want. Unlocker does natively support deletion, renaming etc, too.

[Optional] I'd also like to suggest you to scan computer for threats using Norton Power Eraser (Its free, portable; it can work along with AVG, too) if you don't exactly know whats causing the problem.


From this security Tab, click Advanced, Click the Owner Change link, in the Enter the object name box type your name and click CHECK NAMES then click OK. This will reset the Authority permission to you.


Maybe your file system is corrupted. (see quite similar thread)

Run chkdsk to fix it:

chkdsk /r C:

You might want to try checking the permissions for CMD. Also check your task scheduler in case there's anything unexpected going on.

Sachin Shekhar's idea of using Unlocker is good to see if there is any other processes that is concurrently using the file. The compiler may be having some sort of bug and "hogs" the file even after it has completed it's operations.