How to uninstall AWS CLI on Windows
The AWS CLI keeps your access keys, profiles and cached credentials in a folder under your user profile that its uninstaller never touches. This guide covers AWS CLI v2 installed machine-wide from the Amazon.AWSCLI winget package.
Quit anything using aws first
Close any terminal running an aws command. Check Task Manager (Ctrl+Shift+Esc) for aws.exe before you uninstall, though it normally exits as soon as a command finishes.
Remove the app with its own uninstaller
Go to Settings › Apps › Installed apps, find AWS Command Line Interface v2, and choose Uninstall, or run:
winget uninstall --id Amazon.AWSCLI
Where the data lives
| Location | What it holds | What to do |
|---|---|---|
Program Files\Amazon\AWSCLIV2 |
The aws.exe binary and its bundled Python runtime |
Removed by the uninstaller |
%USERPROFILE%\.aws |
Your profiles, access keys and cached SSO or role credentials, in the location AWS documents as config and credentials under this folder |
Not touched by the uninstaller; back it up if you might reinstall, or remove it yourself once you no longer need those credentials on this machine |
This test never ran aws configure or signed in, so %USERPROFILE%\.aws was never created and could not be checked.
Check the result
Run these read-only commands after the uninstall finishes, ideally from a new terminal window:
aws --version
winget list --id Amazon.AWSCLI
Test-Path "$env:ProgramFiles\Amazon\AWSCLIV2"
Test-Path "$env:USERPROFILE\.aws"
aws --versionfailing with "not recognized" means the AWS CLI is gone from your PATH; printing a version means either the uninstall did not finish or another install is still on your machine.- A completed
winget listquery with no match means the package record is gone; a matching row means the uninstall did not finish. Test-Path "$env:ProgramFiles\Amazon\AWSCLIV2"returningFalsemeans the program folder is gone;Truemeans files remain there.Test-Path "$env:USERPROFILE\.aws"returningTruemeans your profiles and credentials are still there; back them up before removing them if you use AWS elsewhere.
If you installed it with winget
winget uninstall runs the same MSI uninstaller Settings › Apps uses and removes the same program files; it does not touch %USERPROFILE%\.aws.
Account and credentials
Uninstalling does not deactivate an IAM access key, expire an SSO session on AWS's side, or delete anything in your AWS account. Deactivate keys you no longer want from the IAM console if you are done with them.
What Mole lists
For AWS CLI installed machine-wide from winget, the uninstall review lists nothing: the MSI uninstaller removes Program Files\Amazon\AWSCLIV2, its parent Program Files\Amazon folder and the machine PATH entry by itself, so there is nothing left for Mole to offer. Mole also does not show the program folder as a row on its own for this app, because the installer's registry entry does not record an install location; check Program Files\Amazon\AWSCLIV2 yourself if you want to confirm it is gone. %USERPROFILE%\.aws is not part of this list either way.
What this test covered
Tested with AWS CLI 2.37.2 installed through the x64 MSI package (no arm64 package exists for this app), machine scope, elevated. No profile was configured and no command was signed with real credentials during the test, so removing an install with saved credentials was not verified.
