I created this gist on May 25, 2021. It is still an issue as of February 16th, 2026. Welcome to the future of web development. Take this Gist to rest and calm down.
- Uninstall docker the normal way (yeah you may have already done that)
- Copy this (or download):
# Leave swarm mode (this will automatically stop and remove services and overlay networks)
docker swarm leave --force
# Stop all running containers
docker ps --quiet | ForEach-Object {docker stop $_}
#just to be sure, sleep 5 seconds
Start-Sleep -s 5
#take ownership of docker files
if (Test-Path "C:\ProgramData\Docker") { takeown.exe /F "C:\ProgramData\Docker" /R /A /D Y }
if (Test-Path "C:\ProgramData\Docker") { icacls "C:\ProgramData\Docker\" /T /C /grant Administrators:F }
#invoke cmd to delete docker files
cmd /c rmdir /s /q "C:\ProgramData\Docker"- save this as killDocker.ps1.
- go to start > powershell > run as administrator
- run
.\killDocker.ps1
what this does:
- kills all docker containers, if any
- take ownership of all docker files within
C:\ProgramData\Docker - remove
C:\ProgramData\Dockerby invoking cmd, because microsoft powershell is struggling to delete symlinks, of which docker has many
grab a coffee....
after 10 minutes or so it should be done. You're welcome.


Interesting. I think icacls may have received a malformed path argument. Depending on how PowerShell and icacls parsed the script and especially quotation marks and backslashes, it could have fallen back to operating on the current directory or a parent path.
Since you said you navigated to your Desktop in PowerShell before running the script, and icacls with /T (traverse all subfolders) was running, it likely ended up operating on your user profile directory or Desktop, which would then traverse into your Documents folder.
What is your system language?
You could try
icacls "$env:USERPROFILE\Documents" /reset /T /CThis command is used in PowerShell to reset the NTFS permissions on your Documents folder to their default inheritance settings.
Then, you might want to try this slightly path-safer-"ish" version: