I am working on a batch script the clear all the saved credentials on a Windows 10 machine. I got the script off the web, but it doesn't fully work.
@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
The script calls for all the credentials in Windows using cmdkey and dumps it to a file. Then it does a findstr to parse the file. The results that I am having problems with are the ones with spaces in them.
Example: Target: LegacyGeneric:target=Adobe App Prefetched Info (UGhvdG9zaG9wMXt9MjAxODA3MjAwMQ)(Part2)
The script returns only the word Adobe when I need it to return the entire string after target=. Any help would be appreciated.