# \_deps folder requires administrator priviledges to delete

**URL:** https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155
**Category:** Usage
**Tags:** os:windows
**Created:** [December 9, 2024, 9:46am UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155 "2024-12-09T09:46:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![LouChiSoft](https://discourse.cmake.org/user_avatar/discourse.cmake.org/louchisoft/32/4443_2.png) [@LouChiSoft](https://discourse.cmake.org/u/LouChiSoft)
#### Post date: [December 9, 2024, 9:46am UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155/1 "2024-12-09T09:46:58Z")

</div>

I have recently started using FetchContent to manage some dependencies in my CMake project and for some reason the \_deps folder needs administrator priviledges to delete despite not needing them to make the folder in the first place.

Anyone know how to disable this behaviour?

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [December 9, 2024, 8:50pm UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155/2 "2024-12-09T20:50:06Z")

</div>

The `_deps` directory won’t be made that way by CMake itself. If you’re seeing that, I suspect you’re running some steps with administrative privileges, such as `sudo make install`. If you are going to run any command with admin privileges, make sure your build is already fully up-to-date first, otherwise you’re going to run into the sort of problems you’ve described.

---

<div class="post-metadata">

### Author: ![LouChiSoft](https://discourse.cmake.org/user_avatar/discourse.cmake.org/louchisoft/32/4443_2.png) [@LouChiSoft](https://discourse.cmake.org/u/LouChiSoft)
#### Post date: [December 9, 2024, 9:08pm UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155/3 "2024-12-09T21:08:08Z")

</div>

I don’t _think_ I am doing anything with elevated permissions, not unless there is some funky windows things going on. I am just running PowerShell via windows terminal (not developer powershell).

I can consistently run:  
`cmake -B ./build`  
and then  
`rm -r ./build`  
and get the error:

```auto
Remove-Item: You do not have sufficient access rights to perform this operation or the item is hidden, system, or read only.
Remove-Item: You do not have sufficient access rights to perform this operation or the item is hidden, system, or read only.
Remove-Item: You do not have sufficient access rights to perform this operation or the item is hidden, system, or read only.
Remove-Item: Directory C:\Godot\Extensions\GDExtension-Template\build\_deps\godot-cpp-src\.git\objects\pack cannot be removed because it is not empty.
Remove-Item: Directory C:\Godot\Extensions\GDExtension-Template\build\_deps\godot-cpp-src\.git\objects cannot be removed because it is not empty.
Remove-Item: Directory C:\Godot\Extensions\GDExtension-Template\build\_deps\godot-cpp-src\.git cannot be removed because it is not empty.
Remove-Item: Directory C:\Godot\Extensions\GDExtension-Template\build\_deps\godot-cpp-src cannot be removed because it is not empty.
Remove-Item: Directory C:\Godot\Extensions\GDExtension-Template\build\_deps cannot be removed because it is not empty.
Remove-Item: Directory C:\Godot\Extensions\GDExtension-Template\build cannot be removed because it is not empty.

```

I will do some deeper diving to see if there is some Windows shenanigans going on

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [December 10, 2024, 7:57pm UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155/4 "2024-12-10T19:57:34Z")

</div>

Wha CMake version are you using? If you use an older CMake version, do you still see the same behavior?

Do you have a virus checker running and if so, can you exclude the build directory from the directories it scans?

---

<div class="post-metadata">

### Author: ![LouChiSoft](https://discourse.cmake.org/user_avatar/discourse.cmake.org/louchisoft/32/4443_2.png) [@LouChiSoft](https://discourse.cmake.org/u/LouChiSoft)
#### Post date: [December 10, 2024, 8:27pm UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155/5 "2024-12-10T20:27:05Z")

</div>

> Do you have a virus checker running

Ah, that could be it, I will check Windows defender settings

---

<div class="post-metadata">

### Author: ![LouChiSoft](https://discourse.cmake.org/user_avatar/discourse.cmake.org/louchisoft/32/4443_2.png) [@LouChiSoft](https://discourse.cmake.org/u/LouChiSoft)
#### Post date: [December 17, 2024, 8:36pm UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155/6 "2024-12-17T20:36:05Z")

</div>

So I tried setting an exception for the build folder and I still get the same issue. Interestingly this isn’t an issue in the Windows file explorer, I can delete it there without being asked for Admin permission. But still persists in Terminal and IDEs/text editors like CLion/VScode

---

<div class="post-metadata">

### Author: ![sbseltzer](https://discourse.cmake.org/user_avatar/discourse.cmake.org/sbseltzer/32/6086_2.png) [@sbseltzer](https://discourse.cmake.org/u/sbseltzer)
#### Post date: [April 4, 2026, 9:50pm UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155/7 "2026-04-04T21:50:13Z")

</div>

I had the same problem. I don’t know what causes it, but I was able to get rid of the \_deps folder by traversing into its nested .git dirs and manually deleting files in explorer as well. For some reason it allowed me to delete everything without admin permissions when I did things that way.
