# Become owner of all items of a folder

**Date:** 2026-10-05  
**Author:** Kees C. Bakker  
**Original:** https://keestalkstech.com/notes/become-owner-of-all-items-of-a-folder/

---

After copying data (as admin), I noticed I had the wrong owner on it, causing git to fire all sorts of warnings. Here is a one-liner to take ownership of all the files and subdirectories in Windows. Just run it from an **elevated** terminal and your files are yours again.

```ps
icacls "C:\projects" /grant "MY_DOMAIN\my_username:(OI)(CI)F" /T /C
```

Enjoy!
