Windows Defender’s real-time protection can cause CPU spikes, stuttering, and increased load times during gaming as it scans game files and network traffic. Properly configured exclusions reduce this overhead without meaningfully reducing your security posture — game executables and known file locations are already well-analyzed by Microsoft’s cloud intelligence. This guide explains how to configure Defender exclusions safely.
Why Defender Impacts Gaming
Defender’s real-time protection monitors:
- File system reads/writes (every asset loaded from disk)
- Process execution (when game processes spawn)
- Network connections (online game traffic)
- Memory regions (periodic scanning)
During shader compilation or rapid asset streaming, this creates measurable CPU load and occasional I/O latency spikes visible as frame time hitches.
What’s Safe to Exclude
Exclude only directories containing game files from known legitimate sources (Steam, Epic, GOG, Battle.net). Do not exclude system directories, your Downloads folder, or browser executable locations.
Safe exclusions:
- Steam game library:
C:\Program Files (x86)\Steam\steamapps\common\ - Epic Games library:
C:\Program Files\Epic Games\ - GOG library:
C:\Program Files (x86)\GOG Galaxy\Games\ - EA/Origin:
C:\Program Files\EA Games\ - Battle.net games:
C:\Program Files (x86)\Overwatch\, etc. - Game save/config directories if in user folders
Do not exclude:
C:\Windows\System32\C:\Program Files\entirely (too broad)- Your user Downloads, Documents, or Desktop folders
- Browser directories
Adding Exclusions via Windows Security
- Open Windows Security (search in Start menu)
- Click Virus & threat protection
- Under “Virus & threat protection settings,” click Manage settings
- Scroll to Exclusions → click Add or remove exclusions
- Click Add an exclusion → Folder
- Navigate to and select your game library folder
Alternatively, add a Process exclusion for specific game executables if only one game is causing issues:
- Add an exclusion → Process → Enter the .exe name (e.g.,
Cyberpunk2077.exe)
PowerShell Method (Batch Exclusions)
Add multiple exclusions at once via PowerShell (run as Administrator):
# Add Steam and Epic game folders
Add-MpPreference -ExclusionPath "C:\Program Files (x86)\Steam\steamapps\common"
Add-MpPreference -ExclusionPath "C:\Program Files\Epic Games"
Add-MpPreference -ExclusionPath "D:\Games" # Custom game drive
# Add specific process exclusions
Add-MpPreference -ExclusionProcess "cs2.exe"
Add-MpPreference -ExclusionProcess "Cyberpunk2077.exe"
Add-MpPreference -ExclusionProcess "RDR2.exe"
# Verify exclusions were added
Get-MpPreference | Select-Object ExclusionPath, ExclusionProcess
Game Mode vs. Exclusions
Windows 11’s Game Mode (Settings → Gaming → Game Mode → On) automatically prioritizes the foreground game and reduces background activity, including Defender scanning intensity. Enable Game Mode as a first step — it provides most of the benefit with zero configuration.
Exclusions provide additional benefit for games with heavy disk streaming (open-world games, games with large asset libraries).
Additional Defender Tuning
Disable Defender’s Periodic Full Scans During Gaming
Configure scheduled scans to run during off-hours:
# Set scheduled scan to run at 3 AM on Sundays
Set-MpPreference -ScanScheduleDay Sunday
Set-MpPreference -ScanScheduleTime 03:00:00
Controlled Folder Access
If you have Controlled Folder Access enabled (a ransomware protection feature), game save locations may be blocked. Add your game executables to the allowed apps list:
Windows Security → Virus & threat protection → Ransomware protection → Allow an app through Controlled folder access → Add game executables
Cloud-Delivered Protection and Automatic Sample Submission
These don’t impact gaming performance but can cause brief connection spikes. If on a limited connection, disable automatic sample submission:
Set-MpPreference -SubmitSamplesConsent 2 # Never send
Performance Testing
To verify impact before and after exclusions:
- Run a demanding game for 10 minutes with CapFrameX capturing frame times
- Export the frame time data
- Add exclusions
- Repeat the test in the same area
- Compare 1% lows and frame time consistency
Typical results: 2-8% improvement in 1% lows for heavily disk-streaming titles; marginal improvement in CPU-bound scenarios. Open-world games with constant asset streaming (Starfield, Cyberpunk 2077, GTA V) benefit most.
Defender exclusions are a targeted, safe optimization. Combined with Game Mode, a proper power plan, and HAGS, they form part of a comprehensive Windows gaming performance setup.