General discussion

Locked

Script for clearing paging file in Windows XP

By CyberOptiq ·
Does anyone know if a script exist's to clear the paging file whenever one wanted to or if it's possible to do so at all? I'd like to have an icon that I can click on that would do this whenever I wanted to clear it. Thanks!!

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Registry Key Entry

by BFilmFan In reply to Script for clearing pagin ...

It is a registry key entry. No script required.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\ClearPageFileAtShutdown = 1

Collapse -

I know that it can....

by CyberOptiq In reply to Registry Key Entry

be accomplished via the registry and even via the boot up options in msconfig.msc. But that would cause it to clear the paging file EVERY time the machine is either rebooted or shutdown. I'm looking for something that I can run when I want not when the machine dictates. Thanks for your suggestion, though.

Collapse -

Security Policy option for XP Pro as well.

by multiplexed In reply to Script for clearing pagin ...

For XP Pro there's also a security policy that clears the pagefile on shutdown. It probably just changes the registry key mentioned earlier (which would work on both XP Pro & Home), but using the security policy makes it easy to deploy through group policy if needed. Or it makes it easy to copy and import templates to other machines.

"Shutdown: Clear virtual memory pagefile" = enabled

Collapse -

I wouldn't want to do it

by neilb@uk In reply to Script for clearing pagin ...

Wiping out any or all of the paged code and data for your loaded software would probably cause your current session to expire!

Why do you want to do it?

Collapse -

The reason...

by CyberOptiq In reply to I wouldn't want to do it

for wanting to do this is so that I can run it whenever I wanted to at shutdown and not during EVERY shutdown. Having it run every time slowdown's the shutdown process. I'd rather be able to do it sometimes and not all the times.

Collapse -

Yes, but why?

by 3dcad In reply to I wouldn't want to do it

Large pagefiles are annoying, but why would anyone want to do it? What advantages does it have? I do know HOW to do it, but it would wipe out too much embedded information.

Collapse -

Why would anyone....

by CyberOptiq In reply to Yes, but why?

want to do it? Because the ability to do so is there. So why not? What advantage is there? If there were no advantage to it MS would not have made the possibility to do so a part of the Windows OS. If it would wipe out too much embedded information, as you say, then why have the option to so as we have now? It would be nice to get some help with this instead just a bunch of critic's with too much time on their hands. I don't need questions to the question I already posted. If you don't have something constructive to pass on then don't bother replying, please.

Collapse -

Short and to the point

by 3dcad In reply to Why would anyone....

My questions were just that; legitimate questions as to why this process would be feasible. I was genuinely interested in what could be accomplished by such a task, but now, I'll just tell you how it can be done.
There is no easy way I know of as far as any script or code, but if you export the registry key mentioned earlier, you'll have your "switch". Export it the first time, while the value is set to 1,and save it as "On.reg", then change the value to 0 and export it as "Off.reg". Double-click the proper file to update the registry. The downside to this is that you'll have to remember to update the registry by double-clicking the on.reg after you restart, otherwise, another slow boot process. I would be cautious myself, because I would probably accidentally click the wrong one at the wrong time, but that's just me.

Collapse -

Use Scheduler

by kcmplex In reply to Short and to the point

Try using the Reg exports in "Windows Scehduler". Turn it off once a week (or whatever), and in "Windows Start" turn it on, so that it gets turned back on everytime the machine reboots. This assumes the pagefile is cleared at shutdown, not startup.

Back to IT Employment Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums