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.

David Risley is the founder of PCMech.com. He is the brains, the thinker, the writer, the nerd.
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
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.