Skip to content

Instantly share code, notes, and snippets.

@rschweda
Last active May 11, 2026 22:43
Show Gist options
  • Select an option

  • Save rschweda/f0adc34ef8524a1f74dbc24a3a1939be to your computer and use it in GitHub Desktop.

Select an option

Save rschweda/f0adc34ef8524a1f74dbc24a3a1939be to your computer and use it in GitHub Desktop.
Delete all Xbox App network credentials in Windows

Why does this gist exist?

Have you asked yourself why all those XblGrts network credentials exist on your system? For unknown reasons does the Xbox App for Windows create one of those on each login and clutters the credentials management.

What does this script do?

It is a simple batch script creating a list of all stored keys having a name starting with XblGrts and deleting them.

How to run the script?

Create a .bat file with the code below and run it with admin privileges and be happy 🥳

delete-xblgrts.bat

@echo off
cmdkey.exe /list > "%TEMP%\List.txt"
findstr.exe target=XblGrts "%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
@Nyanpasu1

Copy link
Copy Markdown

thank you!

@jdknight

Copy link
Copy Markdown

Bash variant:

cmdkey "/list:XblGrts*" | awk -F ': ' '/Target:/ {print $2}' | xargs -n 1 -I {} cmdkey.exe /delete:"{}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment