Batch file to clear all credentials from Windows Credential Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
Thanks for this. is there a way to only delete credentials from a specific source, say Adobe for example, using this script?
for /F "tokens=1,* delims= " %G in ('cmdkey /list ^| findstr Adobe') do cmdkey /delete %H
This worked for me!
Thanks! This worked for me. I had to add an extra '%' to make it work, as follows:
for /F "tokens=1,2 delims= " %%G in ('cmdkey /list ^| findstr vscode') do cmdkey /delete %%H
@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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not working for me