Skip to content

Instantly share code, notes, and snippets.

@tomfanning
tomfanning / clear-credential-manager.cmd
Last active Aug 20, 2021
Batch file to clear all credentials from Windows Credential Manager
View clear-credential-manager.cmd
@echo off
cmdkey.exe /list > "%TEMP%\List.txt"
findstr.exe Target "%TEMP%\List.txt" > "%TEMP%\tokensonly.txt"
FOR /F "tokens=1,2 delims= " %%G IN (%TEMP%\tokensonly.txt) DO cmdkey.exe /delete:%%H
del "%TEMP%\List.txt" /s /f /q
del "%TEMP%\tokensonly.txt" /s /f /q
echo All done
pause