Pagefile.sys is a secondary file generated during computer usage. It acts as virtual RAM to store unused programs, thereby helping to reduce pressure on the RAM. The size of pagefile.sys is usually similar to the size of the installed RAM, so it can occupy a significant amount of disk space.

To free up additional hard drive space, deleting Pagefile.sys is also a method that can be implemented, and you can even set it to automatically delete every time you shut down.
To configure this feature, you will need to make changes in the Registry. Therefore, carefully follow the instructions as even a minor mistake could cause Windows to malfunction.
Step 1: Access the Registry Editor by pressing Windows + R keys simultaneously. Then type 'regedit' in the dialog box.

Step 2: In the Registry Editor, navigate to: ComputerHKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerMemory Management
Copy the above line and paste it into the address bar, then press Enter.

Step 3: In the 'Memory Management' folder, double-click on the 'ClearPageFileAtShutDown' key.

Step 4: In the Value data field, enter '1'. Then click OK.

Finally, restart your computer and the settings will take effect. From then on, every time you shut down your computer, pagefile.sys will be deleted. But rest assured, it will be recreated whenever needed.
If you found this article helpful, continue to follow Mytour for more Windows 10 tutorials!