Clear Swap File on Shutdown

The swap file is a file which your computer uses on the hard drive that acts as virtual memory. Whenever Windows does not have enough actual memory to do what it needs to do, it uses the swap file. In some instances, people may want to delete the swap file whenever they shut down their computer. For instance, if the work you are doing is sensitive, you might want to do so as somebody with knowhow could read your data from the swap file. To enable this in XP, do the following:

1. Navigate to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > Session Manager > Memory Management
2. Select ClearPageFileAtShutdown from the list on the right.
3. Right on it and select Modify.
4. Change the value to 1 to enable.
5. Reboot your computer.

Note that this will significantly increase the amount of time it takes to shut down your computer.

Free eBook!

Like what you read?

If so, please join over 28,000 people who receive our exclusive weekly newsletter and computer tips, and get FREE COPIES of 5 eBooks we created, as our gift to you for subscribing. Just enter your name and email below:

Post A Comment Using Facebook

  • Larry Miller

    The risks of not doing this are more theoretical than real. It is possible to obtain access to confidential data this way but it is not easy. There are usually other ways which require less effort. This might be useful in a highly secure environment but only as part of a comprehensive security policy. By itself it will provide little security.

    Note that this does not delete the pagefile but overwrites every byte with zero’s. There are NO performance benefits in doing this.

    Larry Miller
    Microsoft MCSA

  • http://fenon.com Lood Kazaz

    Thanks for the post.

    This will benefit more if we need to use the same HDD for back up while not using it as OS Drive. i.e. I have 3 hard drive for my laptop. each one has completely different data and operating system. One of them that has winXP carry all my files on another partition and I would not use this HDD all the time so I do nor need ro waste 1 or 2 GB caused by Swap files.

What’s Your Preference?

Daily Alerts

Each day we send out a quick email to thousands of PCMECH readers to notify them of new posts. This email is just a short, plain email with titles and links to our latest posts. You can unsubscribe from this service at any time.

You can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.

Enter your email address for
Daily Updates:

Weekly Newsletter

Running for over 6 years, the PCMECH weekly newsletter helps you keep tabs on the world of tech. Each issue includes news bits, an article, an exclusive rant as well as a download of the week. This newsletter is subscribed to by over 28,000 readers (many who also subscribe to the other option) - come join the community!

To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.

Enter your email address for
Free Weekly Newsletter: