How to delete the Windows 10 paging file on every shutdown | TechRepublic (2024)

Topic — Software

Published

Written By Mark W. Kaelin

We may earn from vendors via affiliate links or sponsorships. This might affect product placement on our site, but not the content of our reviews. See our Terms of Use for details.

A simple tweak of the Windows 10 Registry file can eliminate one often overlooked security concern.

How to delete the Windows 10 paging file on every shutdown | TechRepublic (2)

Survey after survey tells us that IT professionals and decision-making executives all over the world who work in enterprises of all sizes are most often concerned about security and protecting data. Whether it is enacting draconian access authentication procedures, deploying extraordinary efforts to close security vulnerabilities, or implementing unproven artificial intelligence (AI) systems, those IT pros say something must be done to protect the huge amount of data generated by modern businesses.

One often overlooked potential security vulnerability, albeit a small one, is the existence of the Microsoft Windows 10 paging file on just about every PC in an enterprise. Typically, the paging file (pagefile.sys) takes up space on your primary hard drive and acts as a form of virtual memory for the operating system, freeing up the physical RAM for higher priority applications, drivers, files, etc. Unless you change it, the Windows 10 paging file remains on your hard drive even after shutting down.

SEE: 10 tricks and tweaks for customizing Windows 10 (free PDF) (TechRepublic)

This how-to tutorial shows you how to tweak the Windows 10 Registry file to force the deletion of pagefile.sys every time you shut down your computer, thereby removing any potential security vulnerabilities. With this method, the next time you start your Windows 10 computer, the paging file will be recreated with new data.

Disclaimer: Editing the Windows Registry file is a serious undertaking. A corrupted Windows Registry file could render your computer inoperable, requiring a reinstallation of the Windows 10 operating system and potential loss of data. Back up the Windows 10 Registry file and create a valid restore point before you proceed.

How to delete the pagefile.sys file in Windows 10

To see what your current paging file settings are, follow these steps:

1. Open File Explorer and right-click Computer.

2. Select Properties.

3. Click on Advanced system settings (Figure A).

How to delete the Windows 10 paging file on every shutdown | TechRepublic (3)

4. Click the Settings button under the Performance section and then click the Advanced tab. You should see a screen similar to Figure B. Your current settings for the Windows 10 paging file will be displayed under the Virtual Memory section. In the example, the paging file is currently set to be about 16 GB.

5. Click OK a couple of times to close those screens.

How to delete the Windows 10 paging file on every shutdown | TechRepublic (4)

6. Start the Registry file tweaking process by typing “regedit” into the Cortana search box on the Windows 10 desktop.

7. Click the entry in the search results that refer to the Registry Editor program (regedit.exe).

8. With the app open, navigate to this specific key (Figure C):

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

How to delete the Windows 10 paging file on every shutdown | TechRepublic (5)

9. In the right-hand window, double-click the ClearPageFileAtShutdown key and change the current default value from zero (“0”) to “1” (Figure D).

How to delete the Windows 10 paging file on every shutdown | TechRepublic (6)

From this point on, until you change it back to zero (“0”), the paging file will be completely deleted on shutdown and then restarted fresh each time you start Windows 10.

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Also Read

Mark W. Kaelin

Mark W. Kaelin has been writing and editing stories about the information technology industry, software, hardware, gaming, finance, accounting, and technology geekdom for more than 30 years.

See all of Mark W.'s content

How to delete the Windows 10 paging file on every shutdown | TechRepublic (2024)
Top Articles
Latest Posts
Article information

Author: Clemencia Bogisich Ret

Last Updated:

Views: 5605

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Clemencia Bogisich Ret

Birthday: 2001-07-17

Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

Phone: +5934435460663

Job: Central Hospitality Director

Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.