MSFN Forum: Delete (Not clear) Pagefile at Shutdown. - MSFN Forum

Jump to content


Unattended CD/DVD Guide Homepage · MSFN Forum Rules

If you have questions about customizing Windows XP that are nLite-specific, please post them in the nLite forum, not here. If you have questions regarding the unattended installation of Windows XP, please post them in the Unattended Windows 2000/XP/2003 section.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Delete (Not clear) Pagefile at Shutdown. Rate Topic: -----

#1 User is offline   NATO 

  • Junior
  • Pip
  • Group: Members
  • Posts: 66
  • Joined: 10-May 12
  • OS:XP Pro x86
  • Country: Country Flag

Posted 05 June 2012 - 02:35 AM

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?


#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,682
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 05 June 2012 - 08:08 AM

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.

#3 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,449
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 05 June 2012 - 12:23 PM

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 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,247
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 05 June 2012 - 01:04 PM

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...

#5 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,449
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 05 June 2012 - 01:19 PM

View Postsubmix8c, on 05 June 2012 - 01:04 PM, said:

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 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,247
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 05 June 2012 - 03:03 PM

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...

This post has been edited by submix8c: 05 June 2012 - 03:03 PM


#7 User is offline   Ponch 

  • MSFN Master
  • Group: Patrons
  • Posts: 2,961
  • Joined: 23-November 05
  • OS:none specified
  • Country: Country Flag

Posted 06 June 2012 - 12:21 AM

View Postsubmix8c, on 05 June 2012 - 03:03 PM, said:

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 User is offline   NATO 

  • Junior
  • Pip
  • Group: Members
  • Posts: 66
  • Joined: 10-May 12
  • OS:XP Pro x86
  • Country: Country Flag

Posted 06 June 2012 - 08:30 AM

"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 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,247
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 06 June 2012 - 08:32 AM

View PostPonch, on 06 June 2012 - 12:21 AM, said:

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.

This post has been edited by submix8c: 06 June 2012 - 08:33 AM


#10 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,682
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 06 June 2012 - 09:11 AM

View Postjaclaz, on 05 June 2012 - 12:23 PM, said:

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.

#11 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,449
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 06 June 2012 - 09:59 AM

View PostTripredacus, on 06 June 2012 - 09:11 AM, said:

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 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,247
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 06 June 2012 - 10:13 AM

View Postjaclaz, on 06 June 2012 - 09:59 AM, said:

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...)

#13 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,449
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 06 June 2012 - 12:14 PM

View Postsubmix8c, on 06 June 2012 - 10:13 AM, said:

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 User is offline   MagicAndre1981 

  • after Windows 7 GA still Vista lover :)
  • Group: Patrons
  • Posts: 4,976
  • Joined: 28-August 05
  • OS:Vista Ultimate x86
  • Country: Country Flag

Posted 06 June 2012 - 01:07 PM

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

#15 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,449
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 06 June 2012 - 01:11 PM

View PostMagicAndre1981, on 06 June 2012 - 01:07 PM, said:

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 User is offline   NATO 

  • Junior
  • Pip
  • Group: Members
  • Posts: 66
  • Joined: 10-May 12
  • OS:XP Pro x86
  • Country: Country Flag

Posted 07 June 2012 - 01:26 AM

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.

This post has been edited by NATO: 07 June 2012 - 01:35 AM


#17 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,682
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 07 June 2012 - 07:33 AM

View Postjaclaz, on 06 June 2012 - 01:11 PM, said:

View PostMagicAndre1981, on 06 June 2012 - 01:07 PM, said:

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

#18 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,449
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 07 June 2012 - 09:12 AM

View PostTripredacus, on 07 June 2012 - 07:33 AM, said:

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:

Quote

Improvise, Adapt and Overcome

;) :yes:

jaclaz

#19 User is offline   NATO 

  • Junior
  • Pip
  • Group: Members
  • Posts: 66
  • Joined: 10-May 12
  • OS:XP Pro x86
  • Country: Country Flag

Posted 19 June 2012 - 06:19 AM

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 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,449
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 19 June 2012 - 07:44 AM

View PostNATO, on 19 June 2012 - 06:19 AM, said:

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy