Skip to content

Wipe the page file at every shutdown — via Microsoft Learn

Registrylow riskNeeds adminWindows 11Windows 10

A security option that overwrites pagefile.sys on a clean shutdown, so fragments of memory (which can include passwords or documents) can't be read by someone who boots another OS or removes the drive. The price is a noticeably slower shutdown on PCs with a large page file.

Takes effect right away

Group Policy

Open gpedit.msc (Pro, Enterprise and Education only) and go to:

Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options > Shutdown: Clear virtual memory pagefile

Registry equivalent

Double-click a .reg file and confirm to merge it. Right-click → Edit first if you want to read it, which is always a good idea with any .reg file from the internet.

Apply

Windows Registry Editor Version 5.00

; Oddbyte.Me: Wipe the page file at every shutdown

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
"ClearPageFileAtShutdown"=dword:00000001

Undo

Windows Registry Editor Version 5.00

; Oddbyte.Me: undo Wipe the page file at every shutdown

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
"ClearPageFileAtShutdown"=dword:00000000

Same thing from a command prompt

Run in an administrator Command Prompt or Terminal.

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "ClearPageFileAtShutdown" /t REG_DWORD /d 1 /f

Undo:

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "ClearPageFileAtShutdown" /t REG_DWORD /d 0 /f
Off by default. With it on, the hibernation file is also zeroed when hibernation is disabled. Most useful on dual-boot PCs or where someone could boot another OS from USB. If shutdowns suddenly take ages, check this value first.

Sources

Source reviewed
2026-11-02
Link checked
2026-11-02
Tested hands-on
Not by Oddbyte.Me

Oddbyte.Me hasn't tried this on every Windows build, so keep the undo handy.

pagefilesecurityshutdownprivacyvirtual memory

More in Performance & Power

Check memory pressure, not 'free RAM' — via Apple Support

Tricklow risk

A Mac that shows almost no free memory is usually fine: macOS keeps recently used files cached in RAM so apps reopen faster. The number that matters is the Memory Pressure graph in Activity Monitor, which combines free memory, swap and cached files.