Pagefile.sys acts as a virtual RAM, which Windows uses as RAM to store programs that are not in use, thus putting less pressure on the actual RAM. The page file size is usually near the size of your actual RAM, so it can take up a lot of space depending on your RAM. If you set the pagefile to delete with shutdown, you will save some hard drive space in exchange for slightly prolonging your shutdown time. Here is one way you can get the system to automatically delete the pagefile.sys on shutdown in Windows 10.
To set this up, you’ll be making changes to the Windows registry. This should be safe, but to be super-safe, you should back up your Windows 10 registry before starting.
1. Open the Windows 10 registry editor by pressing Win+ R, then entering
regedit in the box.
2. In the registry editor, go to:
3. Click “Memory Management,” and then double-click on “ClearPageFileAtShutDown” in the panel on the right.
4. Set its value to “1” and restart the PC. Every time you shut down your PC, the pagefile will be deleted. Don’t worry – it will be created again when needed.
If this tip has given you some confidence in the Windows registry, then you can find this and more in our list of Windows registry hacks. We also have a guide on how to edit another user’s registry in Windows 10.