Clears FiveM caches, archives logs and crash dumps, purges GPU shader caches, flushes DNS, and relaunches Steam, Discord, and FiveM — all in one click.
-
Download one of these files to your Desktop:
fivem_clean.bat— double-click to run (works everywhere)fivem_clean.ps1— right-click > Run with PowerShell
-
The script automatically:
- Updates itself to the latest version from GitHub on each run
- Finds your FiveM install (even on D:, E:, or other drives)
- Closes FiveM, Steam, and Discord
- Clears all FiveM caches and GPU shader caches
- Archives your logs to
Documents\FiveM-Logs\ - Flushes your DNS cache
- Relaunches Steam, Discord, and FiveM in the right order
No configuration needed for standard installs.
Run from Command Prompt or create a shortcut with flags:
fivem_clean.bat /norelaunch Don't relaunch apps after cleanup
fivem_clean.bat /skip-steam Don't relaunch Steam
fivem_clean.bat /skip-discord Don't relaunch Discord
fivem_clean.bat /retention:7 Keep logs for 7 days instead of 14
fivem_clean.bat /winsock Reset Winsock (requires admin, needs reboot)
.\fivem_clean.ps1 -NoRelaunch # Don't relaunch apps after cleanup
.\fivem_clean.ps1 -SkipSteam # Don't relaunch Steam
.\fivem_clean.ps1 -SkipDiscord # Don't relaunch Discord
.\fivem_clean.ps1 -Retention 7 # Keep logs for 7 days instead of 14
.\fivem_clean.ps1 -Winsock # Reset Winsock (requires admin, needs reboot)Logs are archived to Documents\FiveM-Logs\ as a timestamped .zip before anything is deleted.
The scripts search for FiveM in this order:
- Default location:
%LOCALAPPDATA%\FiveM\ - (PowerShell only) Windows Registry:
fivem://protocol handler - Root of every drive letter:
D:\FiveM\,E:\FiveM\, etc.
If your FiveM is in a subfolder like D:\Games\FiveM\, edit the script and set the path manually near the top.
"FiveM not found" warning Your FiveM is in a non-standard location the script can't auto-detect. Open the script in Notepad and set the FiveM path near the top of the file.
PowerShell says "execution of scripts is disabled"
Right-click the .ps1 file > Properties > check Unblock and click OK. Or run it directly:
powershell -ExecutionPolicy Bypass -File fivem_clean.ps1
Steam or Discord don't relaunch The script auto-detects Steam on other drives too. If it still can't find it, edit the Steam/Discord paths near the top of the script.
Auto-update says "Could not check for updates" Your internet may be down or GitHub is unreachable. The script will continue with the current version. No action needed.
Winsock reset fails Right-click the script and select Run as administrator.
