Docker Community Forums

Share and learn in the Docker community.

Not able to uninstall completly docker version 18

Not able uninstall completely docker version 18

need to install latest stable versions

go to C:\Program Files\Docker, by opening cmd as administrator.

run takeown /R /F *

run ICACLS * /T /Q /C /RESET,

** don’t run in Program files folder, otherwise you will go to bootloop after restart, go to Docker folder first.

Create the small file with following content and saved with extension .ps1 in Program files folder, and right click on it and Run with Powershell.

kill -force -processname ‘Docker for Windows’, com.docker.db, vpnkit, com.docker.proxy, com.docker.9pdb, moby-diag-dl, dockerd

try {
./MobyLinux.ps1 -Destroy
} Catch {}

$service = Get-WmiObject -Class Win32_Service -Filter “Name=‘com.docker.service’”
if ($service) { $service.StopService() }
if ($service) { service.Delete() } Start-Sleep -s 5 Remove-Item -Recurse -Force "~/AppData/Local/Docker" Remove-Item -Recurse -Force "~/AppData/Roaming/Docker" 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 } Remove-Item -Recurse -Force "C:\ProgramData\Docker" Remove-Item -Recurse -Force "C:\Program Files\Docker" Remove-Item -Recurse -Force "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Docker" Remove-Item -Force "C:\Users\Public\Desktop\Docker for Windows.lnk" Get-ChildItem HKLM:\software\microsoft\windows\currentversion\uninstall | % {Get-ItemProperty .PSPath} | ? { _.DisplayName -eq "Docker" } | Remove-Item -Recurse -Force Get-ChildItem HKLM:\software\classes\installer\products | % {Get-ItemProperty .pspath} | ? { _.ProductName -eq "Docker" } | Remove-Item -Recurse -Force Get-Item 'HKLM:\software\Docker Inc.' | Remove-Item -Recurse -Force Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\Run -name "Docker for Windows" | Remove-Item -Recurse -Force #Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | ForEach-Object {Get-ItemProperty .PSPath} | Where-Object { _.ToString().Contains("Docker for Windows.exe") } | Remove-Item -Recurse -Force .PSPath
#Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | Where-Object { (Get-ItemPropertyValue _) -Contains “Docker” }