Automating Prefetch Cleanup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How would I go about setting up an automated prefetch clean, say like at
least once a month. I know that the prefecth system keeps old and unused
start up files from time to time. Any help would be gladly appreciated.
Thanks in advance. :o)

~Ben
 
Create a batch file:

DEL C:\WINDOWS\PREFETCH\*.PF

Use the Task Scheduler to run it as often as you wish.


Austin M. Horst
 
Create a batch file:

DEL C:\WINDOWS\PREFETCH\*.PF

Use the Task Scheduler to run it as often as you wish.

Is this safe to do automatically as part of my logon script? I
would guess the answer's yes, but with Windows we never know. :-)
 
Sure.
The only files it deletes are those with a .pf extension in the Windows\Prefetch folder.
Any prefetch file "in use" will not be deleted by the command.


Austin M. Horst
 
Ben M. said:
How would I go about setting up an automated prefetch clean, say like at
least once a month. I know that the prefecth system keeps old and unused
start up files from time to time. Any help would be gladly appreciated.
Thanks in advance. :o)

Why do you think you need to clean it up? How long do you think XP even
keeps the older files? Morever, deleting the entire Prefetch file merely
because some of the files may be old or unused is a classc example of
throwing out the baby with the bathwater.

If you want to test this for yourself, rebooth your computer and see how
time how long it takes. Then delete the prefetch file. Then reboot and see
how much time it takes. If speed is your goal, this simple test will cure
you of any urge to "clean" your prefetch file.

You can also do the same test with applications. Reboot your computer, then
open an application and see how many seconds it takes to load. Then clean
your prefetch file, reboot your computer, and open that application again.
It will take longer the second time. The delay won't be as long as the delay
involved in rebooting your computer, but it will still exist.

Ken
 
Ken is correct, the prefetch folder should clean out old entries all by
itself. NOte that your machine needs to "go idle" for this to happen, if
you're the type that turns on your PC, works, then turns it off for the
day then it won't get a chance to run; nor will System Restore. You can
force these events to take place by making a shortcut w/ this command
line:

%windir%\system32\rundll32.exe advapi32.dll,ProcessIdleTasks

this will cause prefetch folder to update (ie, recalc the layout.ini), run
the boot-optimization defrag (if enabled), run system restore to make a
restore check point, and record system info update logs
(C:\WINDOWS\PCHealth\HelpCtr\DataColl); also, performace counter logs will
be written.
 
if you're the type that turns on your PC, works, then turns it off for the
day then it won't get a chance to run; nor will System Restore. You can
force these events to take place by making a shortcut w/ this command
line:

%windir%\system32\rundll32.exe advapi32.dll,ProcessIdleTasks

Great tip; thanks! I am exactly that type -- hibernate the notebook
whenever I'm not working on it. I've been leaving it on just so
thre would be some idle time, but I like the idea of performing the
idle tasks explicitly.
 
Back
Top