When Windows writes memory data to the pagefile, it can contain sensitive information that you don’t want to be accessible on the disk, including passwords. If anyone in your organization works with sensitive information, clearing the pagefile on that desktop is an important step to take to ensure that data isn’t accessible to unauthorized users.

By modifying a registry setting, you can have Windows clear the pagefile on shutdown. This will wipe data written to disk and prevent sensitive files from being accessible. However, the system may take longer to shut down because the computer must write to each page in the pagefile to erase the data contained in it.

To clear the pagefile each time Windows is shut down, perform the following steps:

Run Regedit.
Locate the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management.
Set the value for ClearPageFileAtShutdown to 1.

If the value doesn't exist, add the following:

Value Name: ClearPageFileAtShutdown
Value Type: REG_DWORD
Value: 1

You must restart the computer for the setting to take effect.