STATUS_TOO_MANY_PAGING_FILES (0XC0000097) — quick fix
Windows throws this when you try to create more than 16 paging files. The fix is usually deleting older pagefiles or reducing their count. Rarely a driver issue.
Windows has a hard cap of 16 paging files. Period. Hit that limit and you get STATUS_TOO_MANY_PAGING_FILES (0XC0000097). The system won't create another one until you clean house.
I've seen this most often on servers that get new drives hot-added, or when someone messes with pagefile settings across multiple drives. Also common after cloning a system disk — old pagefiles from the source drive follow along. Let's fix it.
1. Too many pagefiles set across multiple drives
This is the culprit 90% of the time. Windows allows one paging file per logical drive, up to 16. So if you have 20 drives and set a pagefile on each, you'll trip the limit.
Check current pagefile count
# Quick way: check in System Properties
sysdm.cpl > Advanced tab > Performance > Settings > Advanced > Virtual memory > Change
# Or via PowerShell (run as admin):
Get-WmiObject Win32_PageFile | Select-Object Name, InitialSize, MaximumSize
If you see more than 16 entries, that's the problem. The fix is straightforward: uncheck "Automatically manage paging file size for all drives" and manually set No paging file on drives that don't need one. Keep pagefiles only on system drive and maybe one fast SSD for heavy workloads.
Reduce count below 16
- Open System Properties (Win+Pause, or
sysdm.cpl) - Go to Advanced tab, Performance Settings, Advanced, Virtual memory Change
- Uncheck auto-manage
- Select drives one by one and choose "No paging file" until the count under "Total paging file size" drops below 16
- Click Set, then OK, reboot
Don't bother setting a tiny pagefile on each drive to stay under 16 — that's a waste. Pick your fastest drive and set initial = max = 1.5x RAM if you need it. Otherwise let Windows manage on system drive only.
2. Stale pagefiles from cloned or restored disks
This sneaks up on you after a disk clone, a restore from backup, or when you attach an old drive. The old pagefile.sys files still exist on the disk, and Windows sees them as active paging files even if the registry says otherwise.
Find and delete orphaned pagefile.sys
# Run as Admin in PowerShell:
dir C:\pagefile.sys -Force
# If it exists, delete it:
takeown /F C:\pagefile.sys
icacls C:\pagefile.sys /grant Administrators:F
del /F /S /Q /A H C:\pagefile.sys
# Check other drives too:
dir D:\pagefile.sys -Force
dir E:\pagefile.sys -Force
# etc.
Caution: pagefile.sys is a hidden system file. You need dir -Force to see it. On drives that aren't the system drive, you can safely delete it if no other partition on that disk has a pagefile configured.
After deleting, reboot and run Get-WmiObject Win32_PageFile again to confirm count dropped.
3. Registry limit or corrupted pagefile settings
Rare, but I've seen it on Server 2019/2022 where the registry key ExistingPageFiles gets corrupted or has stale entries. This happens after a failed driver update or improper shutdown.
Fix corrupted registry entries
# Backup first, always.
reg export "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" C:\mem_backup.reg
# Delete the ExistingPageFiles value (it gets rebuilt on reboot)
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v ExistingPageFiles /f
# Also check and delete PagingFiles if it contains junk
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v PagingFiles
# If it has entries that don't match your drives, delete and reboot
After deleting these values, Windows recreates them fresh on next boot. This clears out phantom pagefiles that don't exist on disk anymore. Reboot, verify pagefile count is under 16.
Pro tip: If you're on a UEFI system with GPT drives, make sure your boot partition (ESP) doesn't have a stray pagefile.sys. It shouldn't, but I've seen it happen after a failed update. Check withmountvol S: /Sthendir S:.
Quick reference table
| Cause | Check | Fix |
|---|---|---|
| Too many drives with pagefiles | Virtual memory settings shows >16 entries | Set "No paging file" on extra drives |
| Orphaned pagefile.sys from clones | Get-WmiObject Win32_PageFile lists drives you didn't set |
Delete stale pagefile.sys from those drives |
| Corrupt registry pagefile values | Error persists after fixing settings | Delete ExistingPageFiles and PagingFiles registry keys, reboot |
If none of these work, you've got something exotic — maybe a third-party RAM disk or backup tool that creates its own pagefiles. Disable those apps one by one to find it. But honestly, the three fixes above cover 99% of cases. Get your pagefile count under 16 and reboot. Done.
Was this solution helpful?