Unable to delete or take ownership of folder (Windows 7) [duplicate]
Solution 1:
Download PsExec.exe from Sysinternals, this tool allows you to open a command prompt under LOCAL SYSTEM privileges: http://live.sysinternals.com/psexec.exe (put it in C:\temp)
Open a command prompt with Administrator Privileges
CD into C:\temp
Run:
psexec -s -i cmd.exe
, this installs a temporary service which will open a command prompt under LOCAL SYSTEM account. The service will be automatically deleted after you close the screen (i.e. afterEXIT
)Run:
TAKEOWN /F <folder> /R /D Y
, this will set the Administrators group as owner, it also recurses into the folderTo give the Administrators group full control rights, run
ICACLS <folder> /grant administrators:F /T
; the/T
indicates that this operation is performed on all matching files and directories below the directories specified