Clear the paging file automatically when you turn off your PC

The paging file is one of the oldest features of Windows, which still remains very important despite the progress of computers and new versions of the Microsoft operating system.
As I see it, this paging file remains a weak point in Windows, something that would have been better if it were not there or in any case whose impact remained much more limited at least on the more powerful and expensive PCs.
Instead it is always there, both on computers with 2 GB of RAM and with a PC with 8 GB, this file remains essential for the functioning of Windows and even if it can be deactivated, it is never a good idea to do it for the stability of the system.
For those who have never heard of it, the paging file, called pagefile.sys, is practically an integration of RAM memory, so that when it runs out of capacity, programs can use a portion of disk to its place that is also called virtual memory .
Although this prevents the PC from crashing completely, when the hard disk takes over instead of RAM everything slows down monstrously, so it would be better to always balance the capacity of the computer and not to run out of RAM anyway.
While in another article we saw how to set an optimal size for the paging file, here we see how to configure Windows to automatically delete the paging file every time the computer is turned off .
First of all, why should we do this configuration ">
To set the automatic deletion of the paging file there are two ways :
1) The first, easy, only on the Pro and Enterprise versions of Windows 10, 8 and 7, through the local group policy editor .
To get started, search for gpedit.msc in the Start menu and open it.
In the Local Group Policy Editor, on the left side, expand this path: Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options .
On the right side, look for the " System shutdown: delete virtual memory paging file " option, click on it, activate it and press OK.
This also makes it easy to go back and disable the option.
The effects of this change will be seen when the computer is restarted.
2) Using the Windows registry editor
If you are using a Home version of Windows, you must necessarily use the Windows registry to automatically delete the paging file.
To do this, search for regedit in the Start menu and open it.
Once the registry editor has been opened, go to the following key in the left pane:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager \ Memory Management
On the right side, you need to create a new value: then right click on the right panel and select the option New> DWORD value (32-bit)
This new value must have the name ClearPageFileAtShutdown .
Once created, double click on this value and enter the number 1 as the value data.
Reboot the system to make sure the changes take effect and, from this point forward, every time you shut down the system, Windows will automatically delete the paging file.
If you want to go back to the normal configuration, then you can go back to the indicated key and put 0 as the value of ClearPageFileAtShutdown .

Leave Your Comment

Please enter your comment!
Please enter your name here