Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: How can I securely delete pagefile.sys and hiberfil.sys?

28 Dec 2011   #1

Windows 7 Home Premium 64-bit
How can I securely delete pagefile.sys and hiberfil.sys?

I run Windows 7-64 bit Home Premium and work on encrypted containers with TrueCrypt. I'm afraid that such sensitive information (including passwords) may be unencrypted on pagefile.sys or hiberfile.sys. How can I securely delete both of these files? I know there's a method in Windows 7 to delete pagefile.sys at shutdown but I heard from different sources on the net, this is unreliable and does not in fact SECURELY delete the content inside pagefile.sys. Any suggestions?

My System SpecsSystem Spec
28 Dec 2011   #2

Microsoft Windows 10 Professional / Windows 7 Professional

Just disable them and wipe the free space with 0's after that?
My System SpecsSystem Spec
28 Dec 2011   #3
Hopalong X

Windows7 Pro 64bit SP-1; Windows XP Pro 32bit

This will disable hyberfil. It works I have it set disabled on my SSD.> Hibernate - Enable or Disable

I'll post back on page file when I find it.
My System SpecsSystem Spec

28 Dec 2011   #4
Microsoft MVP

Windows 7 Ult. x64

Hi Problemo,

You might want to try Mark Russinovich's SDELETE, from here


It runs from the CMD command line. SDELETE is DoD 5220.22-M compliant. A single pass should be sufficient for your needs.

My System SpecsSystem Spec
28 Dec 2011   #5
Microsoft MVP

Windows 7 Ultimate X64 SP1

Page File Encryption - Enable or Disable
This will help with the pagefile.
My System SpecsSystem Spec
28 Dec 2011   #6
Hopalong X

Windows7 Pro 64bit SP-1; Windows XP Pro 32bit

The only two things I found in sevenforums tutorials is to move the page file to a different hard drive or this> Page File Encryption - Enable or Disable

All I could find.
Good luck.
My System SpecsSystem Spec
28 Dec 2011   #7

Windows XP and Windows 7
sdelete and truecrypt

From a forensic standpoint your data is always on your hard drive the only way to securely get rid of it is to write zeros over that data numerous times. However you DO NOT want to delete or overwrite the pagefile.sys as its a critical system file and Windows caches much of its data on to it. For non system critical files you may want to use sdelete by sysinternals the command is sdelete -p <Times to write over> <File or Directory Path>. E.g. sdelete -p 15 "c:\textfile".

Someone mentioned Truecrypt, it is very stable and very secure. You should use AES 256-bit encryption which has not been cracked.
My System SpecsSystem Spec
28 Dec 2011   #8

Windows 7 Professional SP1 32-bit

pagefile.sys is not a cache for anything stored on the disk, it just stores data paged out of system RAM. It's virtual memory. Of course that doesn't mean it's any less likely to contain unencrypted data that was worked with at any point in time.

The only 100% reliable solution against leaving any unencrypted remnants behind is to encrypt the Windows system partition itself, including the pagefile.sys stored within it as well as any and all cache and temporary files created or modified during a Windows session.

(However, it depends on what's on those Truecrypt-encrypted volumes and how the OP is working with their contents in the first place.)

Another effective, though uncommon, method is to use software to automatically create and format a fixed-size RAM disk at boot time and allocate it with a pagefile.sys, enabling you to keep the pagefile out of any disk-based volumes without having to disable it altogether. Of course using a RAM disk to store a file that's used as virtual memory is a bit...backward.

(I do this on my laptop though, since it has a full 1GB of RAM that my 32-bit Windows can't see but my RAM disk software is able to use separately.)

Clearing the pagefile.sys file at every Windows shutdown is an obvious and simple method requiring a single registry key change which is pretty trivial, but it'll delay the shutdown a lot, and this doesn't address the remaining issue of various cache and temp files left behind on the system volume.

For the record: Clear the page file at shutdown
My System SpecsSystem Spec

 How can I securely delete pagefile.sys and hiberfil.sys?

Thread Tools

Similar help and support threads
Thread Forum
Is hiberfil.sys always on the same partition as pagefile.sys?
Is hiberfil.sys always automatically on the same partition as pagefile.sys? If not: How can I tell Win 7 that it should be this way? Or alternatively: How can I tell Win 7 that hiberfil.sys should be on partition D: ? Peter
Installation & Setup
Unmoveable System Files other than pagefile and hiberfil?
I am trying to shrink a C:\ partition on a Dell R14 laptop running W7 Home Premium 64. I moved the pagefile to D, removed hiberfil.sys, and there are still files way out at 200GB somewhere in a folder, unmoveable by Perfect Disk. No Restore points; System Volume Information is empty. What...
General Discussion
PageFile.sys & Hiberfil.sys - Delete Safe?
Hello SF, I just do a drive clean-up (Deleting some junk files to free some space on my HDD) I managed to see the HD stats what files did takes a lot of space in it using WinDirStat app... I removed some games that I no longer played in a while and some backup files that already made a...
Performance & Maintenance
Win7 Memory hog pagefile and hiberfil?
Hey guys i just recently installed windows 7 bootcamp on my new macbook pro, the hard drive isnt bit (100gb) so i notice right away when a nice chunk of my memory is gone, 4gb to pagefile.sys and 3gb to hiberfil.sys, do i need them can i delete it? thanks.
Performance & Maintenance
pagefile.sys & hiberfil.sys
Hi all, not sure if this is the correct spot for this question but I'll shoot anyway. I've just installed Windows 7 Ultimate using a 50GB partition on my Mac hard drive. I thought this was more than enough room for the OS, but as it turns out I only had 15GB of free space after the installation. I...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 01:05.
Twitter Facebook Google+