RECOMMENDED: Click here to fix Windows errors and optimize system performance
The exchange file stores the virtual memory used by the operating system when the physical memory (RAM) is insufficient to meet all running applications and system requirements. Windows 10 creates a special pagefile.sys file in the root directory of your system drive, like all previous versions of the operating system. You can delete the pagefile file when closing to increase security.
Deleting the stopped exchange file can be important if the PC is used by someone else. It is possible that the exchange file may contain sensitive data after the operating system has shut down. If you have a dual boot system or someone with physical access to your computer, data can be retrieved from this file. When Windows 10 is running, it has exclusive access rights to this file so that none of the applications can read it. However, if your entire partition is not encrypted with Windows BitLocker or similar technology, nothing protects this file if the partition of the installed operating system is accessible by booting another system. In this case, you must delete the exchange file at each stop and replace your confidential information with zeros.
Here is How Windows Clears Pagefile
When you turn off your computer, the system memory is always cleared – it is cleared when it is turned off. But it’s not the exchange file. If you are concerned that someone is looking for sensitive data that may remain in your exchange file, Windows can delete it every time it stops. It writes 0 in each bit of the exchange file and overwrites all existing data. When someone deletes the hard drive from your computer, they cannot check the exchange file to find potentially sensitive data that may have been stored in memory.
There is a real disadvantage to enabling this function. Your computer will take much longer to shut down. Your downtime can vary from a few seconds to a few minutes or even more. This depends on the speed of your computer’s hard drive and the size of your exchange file. This is why Windows does not automatically delete the exchange file when closing. It’s a compromise that most people wouldn’t want.
Delete the file page file.sys
- Open the Control Panel and search for “Advanced System Settings”.
- In the Performance section, click Settings on the Advanced tab.
- Select the Advanced tab again in the window that opens and click on the’Edit…’ button under Virtual Memory.
- Clear the “Automatically manage pagination file size for all drivers” check box and enable the “No pagination file” option.
- You can also change the file size by setting it yourself.
- At the end click on “Apply” and “OK” and restart your PC.
- The swapfile.sys and pagefile.sys files should disappear from your hard disk.
Start Regedit. If you are not familiar with regedit, please read our FAQ to find out how to get started.
- Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
- Select ClearPageFileAtShutdown from the list on the right.
- Just next to it and select Change.
- Change the value to 1 to enable it.
- Restart your computer.
Using the Windows Group Policy Editor
If you are using the Pro or Enterprise version of Windows, you can use the Group Policy Editor to automatically delete the exchange file. First, locate and open gpedit.msc in the Start menu.
The above action opens the Group Policy Editor. Navigate to “Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options” on the left.
- Locate the right pane and double-click the Stop: File Deletion Policy button on the virtual storage page.
- In the policy settings window, select the Radio enabled option, then click the OK button to save the changes.
- Then simply reboot your system for the changes to take effect and you are ready to go. If you want to return, simply select the radio option “Off” in the Policy Settings window.
RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance
CCNA, Web Developer, PC Troubleshooter
I am a computer enthusiast and a practicing IT Professional. I have years of experience behind me in computer programming, hardware troubleshooting and repair. I specialise in Web Development and Database Design. I also have a CCNA certification for Network Design and Troubleshooting.