Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Delete (Not clear) Pagefile at Shutdown.

- - - - -

  • Please log in to reply
21 replies to this topic

#1
NATO

NATO

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 10-May 12
  • OS:XP Pro x86
  • Country: Country Flag
We all know that you can ClearPagefileAtShutdown by either modifying the registry or setting the ClearPagefileAtShutdown in Security options.

But this takes time as the system writes zeros to the pagefile.

Is it possible to completely DELETE the pagefile, in less than one second, so that it can be re-created when the system re-starts?

Batch file maybe?

DEL C:\pagefile.sys ???

But how would you activate it?


How to remove advertisement from MSFN

#2
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,913 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

It can be done using Group Policy, using Logoff Scripts. It might be in Local Security Policy, you'll have to check it out as I don't have an XP PC to look at.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#3
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,584 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
AFAIK the Group Policy is still "clear" (and NOT "delete") see:
http://www.techrepub...p-pagefile/2216

Pagefileconfig.vbs seems like a more suitable choice.

jaclaz

#4
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,331 posts
  • Joined 14-September 05
  • OS:none specified
  • Country: Country Flag
Case in point (I personally don't want to test an AFAICR) -
Clearing it will take just as much time as rebuilding it at startup.
Not swearing to it, because I DON'T want to reboot to my XP right now (have deleted PageFile on it's partition).

You would still be "writing" to it (Shutdown or Startup, whichever).

As jaclaz stated, this will probably work. However, note this in the VBS -
"ERROR: The paging file from volume '%1' cannot be deleted."
" At least one paging file must be present."
SO... it implies that you will have to do a "resize" at the least (to ANOTHER volume) and probably boot twice to "reset" it back to the original.

If your intent is to "defrag" it (force it to be contiguous), the best way (IMHO) would be to redefine it on another partition, reboot, defrag the Volume where it USED to be, then, "redefine" it back (it will be "recreated" on reboot). Note the MFT will still cause potential "contig" probs for the PageFile (MFT will not be affected and could "break" Pagefile into minimum two).

Open to massive corrections by others...

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#5
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,584 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Case in point (I personally don't want to test an AFAICR) -
Clearing it will take just as much time as rebuilding it at startup.
Not swearing to it, because I DON'T want to reboot to my XP right now (have deleted PageFile on it's partition).

AFAICR ;) the pagefile is created (if missing) at startup with a mechanism similar to using FSUTIL (on NTFS), thus it should be very quick. :unsure:

jaclaz

#6
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,331 posts
  • Joined 14-September 05
  • OS:none specified
  • Country: Country Flag
Well, I'm not so sure that a PageFile can be deleted OR resized to "zero" on a Running System. It would have to (AFAIK) be deleted "offline" from an (e.g) WinPE. Hence my statement "have deleted PageFile on it's partition". To clarify, I have done this while running ANOTHER O.S. running on ANOTHER partition that's using a DIFFERENT PageFile (dual-boot).

LiveXP, WinPE, LiveLinux, Dual-Boot ANY other OS that can delete from FAT32 (and/or NTFS) that is NOT "using" the one to be deleted in order to delete it. (???).

1 - Boot to Something Else
2 - Delete PageFile-Of-OS-In-Question
3 - Reboot to What-I-Wanted-To-Delete's-OS
4 - "Rebuilt"

Which methods would be faster? Dunno... Still appears to be a "reboot to something" issue...

Edited by submix8c, 05 June 2012 - 03:03 PM.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#7
Ponch

Ponch

    MSFN Junkie

  • Patrons
  • 3,287 posts
  • Joined 23-November 05
  • OS:none specified
  • Country: Country Flag

t would have to (AFAIK) be deleted "offline" from an (e.g) WinPE.

Like chkdsk on the system disk or programs like "PageDefrag", it can still be performed at reboot while Windows load, so no need to reboot twice ("offline" then "online").

#8
NATO

NATO

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 10-May 12
  • OS:XP Pro x86
  • Country: Country Flag
"Pagefileconfig.vbs seems like a more suitable choice."

Copied it from this machine after reading your reply just in case it is not present on mine.

If I set up a second pagefile on a partition, then I can delete one or the other.

#9
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,331 posts
  • Joined 14-September 05
  • OS:none specified
  • Country: Country Flag

Like chkdsk on the system disk or programs like "PageDefrag", it can still be performed at reboot while Windows load, so no need to reboot twice ("offline" then "online").

Still requires a method of "deleting" before "auto-recreating", true?

I suppose you could initiate a "chkdsk", then "offline" find the Reg Entry(?), then use that as a sample for a "CMD" to execute?

I'm not really into trying this out. I see no other alternatives. It MUST be deleted SOMEWHERE while the OS has NOT been loaded to the point of CREATING the Pagefile! True or not??? ("Offline" no matter how you want to slice-and-dice the "terminology".)

edit - I have no need for such a function, hence the "trying" comment.

Edited by submix8c, 06 June 2012 - 08:33 AM.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#10
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,913 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

AFAIK the Group Policy is still "clear" (and NOT "delete") see:


You can set a GPO to run a program or script at logoff, but I guess it doesn't matter if you can't delete it from a running OS.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#11
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,584 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

You can set a GPO to run a program or script at logoff, but I guess it doesn't matter if you can't delete it from a running OS.

Are you sure you can't delete it?

One should be able to at-least resize it to something like 70รท120 Mb:
http://www.msfn.org/...o-set-pagefile/
and then clear this latter.
How long will it take?
How long will re-creating/expanding it at next boot?

Somehow I feel that another possibility could be to move it's physical location in the Registry :unsure::
http://www.annoyance...nxp/t1040090780
or add a new pagefile on another volume.


Quick test (just made).
Starting from a 500-500 pagefile.sys on C: (%Systemdrive%), created through the normal GUI a new 100-100 pagefile.sys on D; and removed the one on C:
You must reboot for these changes to take effect, bla, bla, bla....
Instead of rebooting, ran Unlocker on the C:\pagefile.sys and Unlocked it (at it went "poof" ;)).

jaclaz

#12
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,331 posts
  • Joined 14-September 05
  • OS:none specified
  • Country: Country Flag

Starting from a 500-500 pagefile.sys on C: (%Systemdrive%), created through the normal GUI a new 100-100 pagefile.sys on D; and removed the one on C:
...
Instead of rebooting, ran Unlocker on the C:\pagefile.sys and Unlocked it (at it went "poof").

But... now you have one on D-Drive? :blink:

That "other MSFN topic" you were looking at seems a potentially more viable option... (been watching...)

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#13
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,584 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

But... now you have one on D-Drive? :blink:

Sure but it is 1/5 of the original and it will take roughly 1/5 of the time to be cleared.
Since on this machine I have more than 2 gb of RAM and currently the pagefile is not in use (I am "peeking at around 700 Mb of used memory), I can allright delete the pagefile (on whichever drive it is), this is actually what I have done while I am typing this post.
The "vanishing" is "immediate".
I cannot for a number of reasons reboot right now, so I have no idea what will happen then (if a pagefile will be created at all, if it will be created with the "windows managed settings, whatever).
Please let us not transform this otherwise peaceful thread in the usual "Windows can run without a pagefile vs. No, you d@mn id*** it cannot", or of the "You better leave pagefile managed by windows vs. "NO, it should be 1.5 to 2.0 x your RAM size", "Godzilla vs. King Kong" (and YES, the dinosaur can kick that grown up chimpanzee's @ss all the way to the moon and back with BOTH hands tied behind it's back ;)).

jaclaz

#14
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 6,093 posts
  • Joined 28-August 05
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

you can't delete it when Windows runs. Windows can only add a new pagefile when it runs, but you can't remove it.
Posted Image

#15
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,584 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

you can't delete it when Windows runs. Windows can only add a new pagefile when it runs, but you can't remove it.

Well, then I managed to just do something impossible. :w00t: :ph34r:

jaclaz

#16
NATO

NATO

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 10-May 12
  • OS:XP Pro x86
  • Country: Country Flag
Good thinking jaclaz, as always.

Annoyances is on the verge of quitting, btw.

Unlocker it is.

"How to configure paging files for optimization and recovery in Windows XP"

For those who don't know about this article.

http://support.microsoft.com/kb/314482

Ian.

Edited by NATO, 07 June 2012 - 01:35 AM.


#17
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,913 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator


you can't delete it when Windows runs. Windows can only add a new pagefile when it runs, but you can't remove it.

Well, then I managed to just do something impossible. :w00t: :ph34r:

jaclaz


Well yes, using an unlocker (or closing some handles) might be considered "cheating" :angel
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#18
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,584 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Well yes, using an unlocker (or closing some handles) might be considered "cheating" :angel


Oww, comeon :angel , in love, war and MS computing there are NO rules :w00t: , or if you prefer:

Improvise, Adapt and Overcome

;) :yes:

jaclaz

#19
NATO

NATO

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 10-May 12
  • OS:XP Pro x86
  • Country: Country Flag
Hmmm;;;

So I used pagefile.vbs to delete the Primary drive pagefile (there is one on the 1st logical as well) and it said success! whatever.

So I ran analyse in Defrag and it was still there only it had changed from green to blue.

Unlocker deleted it.

Wonder if there is any way to pin the pagefile to the back of the partition so as to keep it away from the OS files when defragmenting without using Perfect Disk or some other third party defragmenter.

The standard defrag plus the addition of Sysinternals Config does a good enough job.

Diskeeper is to heavy for a 1.0GHz PIII

#20
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,584 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Wonder if there is any way to pin the pagefile to the back of the partition so as to keep it away from the OS files when defragmenting without using Perfect Disk or some other third party defragmenter.

JFYI, the "old school" method was to create a dedicated partition (possibly on another disk) to ONLY hold the pagefile.

If on another disk, when "hit", it will be way faster than on System partition (or than other partition on same disk).

In any case it will be hit seldom (please read as "never" :rolleyes: :whistle: ) if you have RAM in quantity adequate to the OS and applications you are running.

jaclaz

#21
anu damiana

anu damiana
  • Member
  • 1 posts
  • Joined 22-May 14
  • OS:XP Pro x86
  • Country: Country Flag

 

Quote

Improvise, Adapt and Overcome

 

Oh, my....I'm thinking i might like this place,,,   :-)



#22
TELVM

TELVM

    Advanced Member

  • Member
  • PipPipPip
  • 303 posts
  • Joined 09-February 12
  • OS:Windows 7 x64
  • Country: Country Flag

... Is it possible to completely DELETE the pagefile, in less than one second, so that it can be re-created when the system re-starts? ...

 

I do exactly that by placing a vestigial pagefile* in a ramdisk, which dematerializes on shutdown and rematerializes on startup.

 

* (Some stupid programs start bitching when they can't find a frigging pagefile).






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users