pagefile.sys, can it be deleted?

E

Edge30

Hello,

I've seen lots of pages which recommend different methods to delete the
pagefile.sys.
The most popular methods, even posted by MS, include enabling in the local
security policies an option to automatically delete the file during shutdown
or running a script in the system32 folder (pagefileconfig.vbs /delete /VO
c:)
These methods are very popular and everybody uses them... but I haven't seen
anybody saying that they actually work...
The reason is that they are "supposed" to delete pagefile.sys at shutdown,
so, if the PC is off nobody can actually check this is true.
When the PC is started next time the file is re-created so... so again,
nobody can confirm it was really deleted before

In my case due to my work I deal with HDDs all the time and I have taken the
HDDs to other systems, even other OS, and check and... the file is always
still there...
I've been behind this for months, tried tons of different systems and never
saw one single case where these methods work.

Has anybody done the same tests?
Does anybody know a method that, for certain, will delete the pagefile.sys?

The problem is that it is 1.5 times local ram. And current systems have
minimum 4GB ram, with 8 and 16 being typical so when I create a partition
image for further cloning if I don't remove it then the image file is
excessively large (unnecesarily).
I always have to remove the file manually from other OS but I would like to
know if there's a real method to do it from XP (or Vista as both show
exactly same behavior)

Note: I know using sysprep deletes this file, but for my specific
application I don't use sysprep

Any ideas?
Thanks
e.
 
J

John John (MVP)

Clear Paging File at Shutdown doesn't delete the pagefile, it clears
(wipes) the contents of the file by zero filling the file.

For obvious reasons the operating system has an exclusive lock on the
pagefile so it cannot be deleted while Windows is up and running. To
delete the file you must configure Windows so that it doesn't recreate
the file when it reboots, or you have to delete the file while Windows
is asleep, but of course, when Windows reboots the Session Manager will
recreate the pagefile as per the instructions in the Paging Files entry
at HKLM\SYSTEM\ControlSet###\Control\Session Manager\Memory Management.

John
 
I

Ian D

Edge30 said:
Hello,

I've seen lots of pages which recommend different methods to delete the
pagefile.sys.
The most popular methods, even posted by MS, include enabling in the local
security policies an option to automatically delete the file during
shutdown or running a script in the system32 folder (pagefileconfig.vbs
/delete /VO c:)
These methods are very popular and everybody uses them... but I haven't
seen anybody saying that they actually work...
The reason is that they are "supposed" to delete pagefile.sys at shutdown,
so, if the PC is off nobody can actually check this is true.
When the PC is started next time the file is re-created so... so again,
nobody can confirm it was really deleted before

In my case due to my work I deal with HDDs all the time and I have taken
the HDDs to other systems, even other OS, and check and... the file is
always still there...
I've been behind this for months, tried tons of different systems and
never saw one single case where these methods work.

Has anybody done the same tests?
Does anybody know a method that, for certain, will delete the
pagefile.sys?

The problem is that it is 1.5 times local ram. And current systems have
minimum 4GB ram, with 8 and 16 being typical so when I create a partition
image for further cloning if I don't remove it then the image file is
excessively large (unnecesarily).
I always have to remove the file manually from other OS but I would like
to know if there's a real method to do it from XP (or Vista as both show
exactly same behavior)

Note: I know using sysprep deletes this file, but for my specific
application I don't use sysprep

Any ideas?
Thanks
e.

Go to Control Panel > System >Performance > Advanced >
Virtual Memory > Change, and select No paging file > Set.
After you reboot, the paging file should be gone. If not,
just delete it, as the system will not be using it. Note that
having no page file can cause unexpected results with
some applications that expect a paging file to be present.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top