System hacks: Proper handling of Pagefile.sys files

Pagefile.sys, as a temporary page file for virtual memory in Windows 10, usually takes up GBs of disk space on the system partition. Sometimes we need to shift, reset or even delete this file in order to achieve the best balance between system efficiency and space. So, how can we find the Pagefile.sys file and deal with it in the right way?

1. Pagefile.sys file and its location

By default, the Pagefile.sys file is located in the root directory of the partition where the Windows system is located. Since it has both “System” and “Implicit” attributes, this file is not yet visible only through the Show Implicit Files checkbox in File Explorer. You can only see this file if you turn on the option to show both hidden and system files in the Folder Options window.

Sometimes we also move the file to a memory virtual drive, another partition with enough space or an additional solid state drive for purposes such as system acceleration or space freeing. In this case, you can first right-click “Start” and select “System”, then click “System Information → Advanced System Settings”; next, click “Advanced” under the “Advanced” tab. Next, click “Performance→Settings” under the “Advanced” tab; then, click “Advanced→Change” (Figure 1).


Finally, specify the location of the paging file and the size of the paging file by specifying automatic management or manual selection in the “Virtual Memory” settings window (Figure 2).


Tip: After the pagefile is modified, you need to click the “Settings” button and restart the system to make the settings take effect. 2.

2. Can the Pagefile.sys file be deleted and the correct way to delete it?

The Pagefile.sys file is locked by the system and cannot be deleted while the system is running. However, if you start the machine with another system, you can delete the Pagefile.sys file that is not currently shared. after the Pagefile.sys file is deleted, if you start the system it is on again, the system will automatically rebuild the file as long as the page file setting in the system settings is not turned off.

The Pagefile.sys file can also be deleted in a scientific way if the machine has added enough physical memory or if you wish to free up space due to lack of disk space.

First, using the path described above, turn off the page file setting in the System Advanced Settings. Next, open the Registry Editor, locate “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerMemory Management” in order, and double-click DisablePagingExecutive and change its value data to 1 to disable the page file (Figure 3).


Finally, after rebooting the system, go to the root directory of the partition where the original page file is located and look for the Pagefile.sys file, find the file and delete it. Since compression software can directly display files with implicit or system attributes, we can directly use compression software such as WinRAR or Good Compression to open the partition to view and handle it directly.

Tip: Re-enable the Pagefile.sys file

First of all, as described above, set the value data of DisablePagingExecutive to 0 in the registry; then go to the system advanced properties settings, set the option to turn on the virtual memory page file, set the page file to be automatically managed by the system or manually set a certain number of page file size.

Leave a Comment