Modify Windows Pagefile Size and Location via Regedit
This article explains how to configure the Windows paging file
(virtual memory) size and drive location using the Windows Registry
Editor (regedit). Modifying these settings directly through
the registry is useful for automated deployments, headless system
configurations, or troubleshooting scenarios where the standard System
Properties graphical user interface is unavailable.
Step 1: Open the Registry Editor
- Press
Win + Rto open the Run dialog box. - Type
regeditand pressEnter(or click OK). - If prompted by User Account Control (UAC), click Yes to grant administrative permissions.
Step 2: Navigate to the Memory Management Key
In the Registry Editor, use the left sidebar or copy and paste the following path into the address bar at the top:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
Step 3: Disable Automatic Pagefile Management
Before setting custom sizes or locations, ensure Windows is not automatically managing the paging file across your drives:
- Locate the DWORD value named
AutomaticManagedPagefilein the right pane. - Double-click
AutomaticManagedPagefileand set its Value data to0. - Click OK.
Step 4: Configure the Pagefile Placement and Size
- In the same registry key, locate the Multi-String Value
(
REG_MULTI_SZ) namedPagingFiles. (If it does not exist, right-click an empty space, select New > Multi-String Value, and name itPagingFiles). - Double-click
PagingFilesto open the Edit Multi-String dialog. - Enter your desired configuration using the format:
[Drive:\]pagefile.sys [Initial_Size_MB] [Maximum_Size_MB]
Configuration Examples:
Fixed Size Pagefile on the C: Drive (e.g., 4 GB Min / 8 GB Max):
C:\pagefile.sys 4096 8192Moving the Pagefile to a Secondary Drive (e.g., D: Drive with 8 GB Fixed Size):
D:\pagefile.sys 8192 8192System-Managed Pagefile on a Specific Drive: Setting both size parameters to
0allows Windows to dynamically scale the pagefile on that specific drive:D:\pagefile.sys 0 0Multiple Pagefiles Across Different Drives: Enter each drive configuration on a separate line within the same
PagingFilesvalue editor:C:\pagefile.sys 2048 4096 D:\pagefile.sys 4096 8192Disabling the Pagefile Completely: Leave the Value data field blank or delete the string lines inside the
PagingFilesentry.
Step 5: Apply the Changes
- Click OK to save the changes to the
PagingFilesregistry entry. - Close the Registry Editor.
- Restart your computer for the new paging file placement and size configurations to take effect.