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

  1. Press Win + R to open the Run dialog box.
  2. Type regedit and press Enter (or click OK).
  3. 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:

  1. Locate the DWORD value named AutomaticManagedPagefile in the right pane.
  2. Double-click AutomaticManagedPagefile and set its Value data to 0.
  3. Click OK.

Step 4: Configure the Pagefile Placement and Size

  1. In the same registry key, locate the Multi-String Value (REG_MULTI_SZ) named PagingFiles. (If it does not exist, right-click an empty space, select New > Multi-String Value, and name it PagingFiles).
  2. Double-click PagingFiles to open the Edit Multi-String dialog.
  3. Enter your desired configuration using the format: [Drive:\]pagefile.sys [Initial_Size_MB] [Maximum_Size_MB]

Configuration Examples:

Step 5: Apply the Changes

  1. Click OK to save the changes to the PagingFiles registry entry.
  2. Close the Registry Editor.
  3. Restart your computer for the new paging file placement and size configurations to take effect.