Skip to content

Instantly share code, notes, and snippets.

@classworks
classworks / clear-credential-manager.cmd
Created May 6, 2020 — forked from tomfanning/clear-credential-manager.cmd
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