« // »

Resetting NTFS File Permissions

From time to time after you’ve installed a piece of software and removed it (or removed users) you’ll find that you’re unable to delete a file or directory from Windows when using a NTFS file system (and that’s really the only file system you should be using for Windows).

The simplest way to handle that (assuming all you’re doing to do is delete the file or directory) is to do the following in a command prompt:

takeown /R /F %1

icacls %1 /T /Q /C /RESET

%1 is the Windows convention for a parameter (so you could put this in a batch file); you can manually substitute the name of the file or directory; also you could change into the directory containing the files and/or directories and use “*” (wildcard) rather than a file name.

NOTE:  You will need to elevate the privilege of the command prompt (launch it as user ‘administrator’).

Originally posted 2013-09-11 12:00:23.

« // »