Would you like to move the Pagefile.sys to a specific folder? Or set this file via the registry for more complex system configurations such as multi-boot and networks? Here we provide instructions on how to change the file path and file name of the system file via regedit.
Quick overview:
To change the Pagefile.sys via the registry (directory and file name)
While the advanced system settings usually only allow you to change the size and activate/deactivate the Pagefile.sys in Windows the registry offers more options.
This is a more advanced method that requires precise handling, but don't worry - we'll guide you safely through every step:
- Open the registry editorType regedit in the Windows search and open the registry editor.
- Navigate to the right keyNavigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management.
- Find 'PagingFiles' valueFind the entry 'PagingFiles'. This determines the storage location and the name of the Pagefile.sys.
- Make changesDouble-click on 'PagingFiles' and enter the new path and file name, for example D:\subfolder\pagefile01.sys.
- Save changesClick on 'OK' and close the registry editor.
- Reboot system: A restart of your computer is required for the changes to take effect.
When can changing the Pagefile.sys with regedit be useful?
The editing of the Swap file via the Windows registry instead of the advanced system settings can be more useful in the following cases:
- Specific requirements for storage location and file name: The registry allows a more detailed and specific configuration of the location and file name of the Pagefile.sys. This can be useful if you want to place the Pagefile.sys in a specific directory, which is not directly possible via the system settings.
- Complex system configurationsIn complex or customized system configurations, such as multi-boot systems or in network environments, customization via the registry may be necessary to avoid conflicts with other operating systems or network policies.
- Automation and scriptingFor IT professionals who want to make changes to multiple systems or automate configurations, the registry offers the option of using scripts that access the registry settings directly.
What must be observed when editing the registry?
- Caution is advisedChanges to the registry can have a significant impact on your system. Therefore, proceed carefully and understand exactly what you are doing.
- Backup of the registryIt is advisable to create a backup of the registry before making any changes in order to be able to restore it in the event of problems.
- System monitoringMonitor your system closely after the restart to ensure that everything is working smoothly.
Founded Windows Tweaks as a teenager in the 90s. His helpful PC tricks made it Germany's most visited Windows site (at the time Sandro looked like this). He then went on to write elsewhere, for example for PC-Praxis, Computer Bild and PCWorld in the USA. Microsoft also poached him from us. Now Sandro is back, finally sharing his tweaks here again. For a stress-free digital everyday life. You can reach Sandro via e-mail.

Hello & welcome 👋
On Windows Tweaks you will find time-saving tech guides for PC, software & Microsoft. For a stress-free digital everyday life. Already we have been "tweaking" Windows since 1998 and just won't stop!
On Windows Tweaks you will find time-saving tech guides for PC, software & Microsoft. For a stress-free digital everyday life. Already we have been "tweaking" Windows since 1998 and just won't stop!
New Windows Guides