Đôi khi bạn cần xóa tất cả credentials lưu trong Credential Manager; ví dụ: mật khẩu không hoạt động trên thiết bị Windows 10 nhưng vẫn dùng được trên thiết bị khác. Bài viết hướng dẫn xóa toàn bộ credentials bằng file Batch.

Windows Credential Manager lưu tên người dùng, mật khẩu, thông tin đăng nhập khác để dùng sau cho website, app, mạng. Credentials chia 4 loại:
- Windows Credentials: Dùng bởi Windows/dịch vụ (ví dụ: đăng nhập tự động chia sẻ thư mục mạng, Homegroup).
- Certificate-Based Credentials: Dùng với smart card, môi trường doanh nghiệp phức tạp.
- Generic Credentials: Được app định nghĩa (OneDrive, Slack, Xbox Network...).
- Web Credentials: Thông tin đăng nhập web lưu bởi Windows, Skype, IE, Edge (chỉ có Win 10/8.1).
Đọc thêm: Xóa Credentials qua Command Prompt.
Xóa tất cả credentials bằng Batch file
Thay vì xóa từng cái, tạo file batch từ nguồn Github để xóa tất cả:
- Win + R > gõ
notepad> Enter. - Dán mã sau vào Notepad:
@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
- Lưu file (khuyên lưu Desktop) tên
ClearCREDS.bat, Save as type: All Files.
Để xóa: chuột phải file batch > Run as Administrator.
Có thể lập lịch chạy tự động file batch này trên Windows 11/10.
Bài liên quan: Add, Backup, Restore User Credentials bằng Windows Vault.