takeown /F "D:\Program Files" /A /R /D Y icacls "D:\Program Files" /T /grant administrators:F rd /s /q "D:\Program Files"
Źródło: https://superuser.com/a/1028115