Tech Support Forum banner
Status
Not open for further replies.

Prefetch cleaning.

7K views 24 replies 8 participants last post by  yustr 
#1 ·
I've got issues with the Windows Prefetch.
I want more control over the Windows Prefetch folder. What goes in, what does not go in, when it is emptied... etc.
Yes, I can manualy open Windows Explorer and delete the contents, but I'd rather have something that gives me more utility.

Anyone know of a solution?
 
#2 ·
"Cool Batch File to Clean Your PreFetch Folder

Last week we showed you a way you could speed up your Windows XP start times by cleaning up your PREFETCH folder. Tony Rairden wrote in with a neat suggestion on how to make it a simple batch file to clean things up quick:

"Why not put this procedure into a batch file (I call mine XP SpeedStart.bat) containing the single line:

del c:\windows\prefetch\*.* /Q

Then either schedule that batch file to run weekly or include it in the Startup folder."

Info found Here
 
#4 ·
I agree with johnwill, it will slow down your boot process, but it is harmless if you delete :sayyes:

"The Prefetch folder is used by Windows XP to speed the boot process. Windows XP records information about each program that launches at boot and uses that information to boot faster the next time. Because multiple files might have the same name, it appends a "hash" of the file's location. That's the odd string of numbers and letters between the filename and the .pf extension.

This folder may accumulate useless junk, especially if you change your configuration a lot. There's no harm in emptying it. Simply delete all the files in that folder; Windows will rebuild it as needed." info
 
#5 · (Edited)
johnwill said:
Many defrag utilities update the prefetch folder to current conditions when you run them. This would seem to be a good way to manage it.

Why would you want to totally clear it? That would seem to just slow down boots...
No, actualy it speeds them up in my case.
See, every time you open a program, an entry for that program goes into prefetch. So, even if you only ever run that program once, it still is prefetched next time you start your computer. That means that windows is wasting time prefecthing programs it doesn't need to. Heck, it's trying to prefetch programs that were deleted!
Sloppy, Microsoft. Really damm sloppy.
The wasted time is amplified by my anti-virus (which is on-access scaning the prefetch) and my software firewall (which must wait until the prefetch is over before it can start it's MAC bridge miniport).

So, to be clear: I don't just want to run something that cleans the prefetch (although having something that auto-cleans it on shutdown would do). I want to be able to control what goes in the prefetch in the first place.
Capiche?
 
#6 · (Edited)
Geekgirl said:
The Prefetch folder is used by Windows XP to speed the boot process.
Not exactly true. Booting with prefetch disabled via a registry hack will slow down boot time considerably. So, yes: The prefetch can speed your boot process.. but...
If only the prefetch prefetched just the programs that need to run at startup or imediately therafter (or don't need to, but do anyways) it would avoid a lot of problems. However, the codemonkey that wrote the prefetch didn't think to do that, and so preftech builds a long and semi-useless list of every single process, application, service, etc., that you have run. If the damm thing would only limit itself to programs that need to run at startup, it would be a lot more efficient. I think they did it this way so that M$ Office would appear to start lightning-fast compared to the competition. (Office expoits a secret part of the underlying code in Windows that M$ won't show to us meer mortals)

Prefetch programs that don't run at startup do not benifit signifigantly from being prefetched. (Test it yourself if you don't believe me). So, there's little or no benifit to having most apps having a entry in the Prefetch fiolder.

Now do you see why I want to do what I want to do?

I've been looking for a regitry hack for the prefetch, but so far no luck.
 
#7 ·
Not sure how well this works, but the Registry setting for the Prefetch has multiple settings.

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters\EnablePrefetcher

can be set to either:

0 - to disable prefetching
1 - to prefetch application launch files
2 - to prefetch boot files
3 - to prefetch as many files as possible

I'm presuming your setting is 3. Try setting this to 2 and clearing the prefetch folder of all files and let windows rebuild it - this may solve your problem.
 
#9 ·
Well, with that registry hack that ReeKorl provided (thanks for that) I now find that (with the hack set to 2 from the default 3) I only ever get one entry in the prefetch folder. Not quite what I was after, but it's much better than it was before.
I had been hoping for some utility app that would allow me to selectively filter what goes in there, but this way it certainly speeds up the start of my MAC bridge.

Before, I was seeing waits of up to a minute, now I average 13-15 seconds. Thanks, guys.
 
#10 ·
Glad to help.

I've been looking further into this, and unfortunately I can't seem to find any reference to a utility of any kind which will manage your PF for you.

Maybe this could be a challenge for any budding programmers out there? Write some sort of application which monitors what windows is trying to put into the PF folder and bring up an allow/deny prompt for every different file windows tries to PF with a "Never ask me again for this file" box?

The gauntlet has been thrown down.....
 
#12 ·
I have my PrefetchParameters\EnablePrefetcher set to 5 and it only has 1 of each application. Yes it has more than bootup applications. I have found that some applications start faster if I put /prefetch:1 after the exe in the target found when you right click the application icon and choose Properties. You must leave a space after exe and before the slash (\). this does not work with all applications. It will let you know and you can remove it. Test it and see what happens. It can't hurt.
 
#14 ·
wahlroot said:
I have my PrefetchParameters\EnablePrefetcher set to 5 and it only has 1 of each application. Yes it has more than bootup applications. I have found that some applications start faster if I put /prefetch:1 after the exe in the target found when you right click the application icon and choose Properties. You must leave a space after exe and before the slash (\). this does not work with all applications. It will let you know and you can remove it. Test it and see what happens. It can't hurt.
Too bad I'm not a programer or that would be a nice way to base writing code for a "Prefetch Watchdog".... where's a codemonkey when you need one? :dead:

:gets out a virtual bannana:
:temps codemonkeys with a virtual bannana:
Here, codemonkey. Nice codemonkey. :cool:
 
#15 ·
wahlroot said:
I have my PrefetchParameters\EnablePrefetcher set to 5
If you clear out your PF directory, does it actually fill up again? I'm only asking because Microsoft don't recognise any value above 3 officially, because of the way it works.

Code:
Value Names:

EnablePrefetcher (DWORD)
0x00000001= application launch prefetching
0x00000002= boot prefetching

Parameters are ANDed, so if all were enabled, the setting would be 0x00000003.
A value of 5 would be application prefetch (1) and some other unspecified prefetch (4)
 
#16 ·
Yeah, if you delete the contents of your C:\Windows\Prefetch folder, it will fill up again. Next time you run a program that the prefetch service didn't yet cache that session, prefetch either adds or revises (not sure if it's overwritten or if it's apended) an entry in the prefetch folder. I think some information must be stored in the registry regarding this, but dammed if I know where.
I can hack the registry a bit, but I'm not initiated into it's higher mysteries yet. Somewhere within it's arcane myseries, burried deep beyond the bit of code that details the contract between Microsoft and Mephistophiles, lies the answer.
Or it could be posted on the internet in a place I haven't looked yet. :1angel:
 
#17 · (Edited)
Normally yes, it does refill, but I was asking in the case of that 5 setting - technically, Windows should get confused and not do anything because it doesn't know what to prefetch.

It would be like me asking you to get something, and when you asked me what I wanted I told you "Five past nine in the morning". You wouldn't know what to get, and neither should Windows with that setting.

I would try changing it here, but the company's computers are locked down tighter than a camel's nostril in a sandstorm.

Oh, and don't hold your breath while looking for enlightenment on all things registry - it's beyond the comprehension zones of the human brain. Especially now that it's size is only limited by the capacity of your HDD. Give it another decade and you'll be looking at a 15 gig registry :rolleyes:
 
#18 ·
I first copied the contents of the prefetch folder to a temp folder (in case i needed to reload) then deleted everything from the prefetch.

I set my prefetch parameter to 2 in the registry.

That was 2 days ago any there are NO entries in the prefetch folder. So windows (at least my version XP Pro SP1) does not rebuild the entries.

Does it build it only when a program is initially loaded? The latest entry in the (copied) folder is last September
:4-dontkno

I have not noticed any change in my boot speed or anything else for that matter. Just another example of superfluous code – lazy engineering!? :4-thatsba
 
#19 ·
Try setting that registry entry to 2 instead of 1.
 
#22 · (Edited)
OK, I tried it. So far, it seems alright. I don't know what the registry hack was that TuneXP used, but i'm gonna poke around in the registry and see if I can figgure that one out.
Or, I might just ask tyhe guys who wrote it. :sayyes:

EDIT: Ok, I tested the post TuneXP configuration out, and two things are of note:
Programs that don't need to load at startup are now once again loading at startup.
The registry entry HKEYLocalMachine \SYSTEM \CurrentControlSet \Control \Session Manager \Memory Management \PrefetchParameters \EnablePrefetcher shows a value of 3.
Well, that was no help.
Anyways, I guess I'll go back to a prefetch of 2. That's for the help, guys.
 
#23 ·
Here's a finding:

As posted below, I emptied my prefetch folder, set registry key to 2 and windows did not rebuild the folder.

So far, it was a big "So what". The machine seems to behave normally.

Well this moring I tried to access the System through Control Panel>System and got no response.

I was in the middle of posting a question about that when I thought "I wonder what happens if I put the saved prefetch items back". So I did that and after a reboot, guess what - System now works just fine.

So I guess it's there for something.
 
#24 ·
That sounds a little weird, and possibly worrying. It sounds like the prefetch is being used instead of the regular access method, and something has gone wrong with that access method. Without the prefetch files, it falls over and can't do it, but with it can do it.

Simple analogy - Crossing a river. 2 methods - the normal one (Using a bridge) and the prefetch one (using a boat).

Your system can't now find the bridge and has gone back to using the boat. Although this works, why has the bridge gone missing?

However, it's also possible the two are unrelated and simply coincidental that you've solved it by replacing the prefetch.

When you say that the prefetch folder remained unbuilt with a setting of 2, were there absolutely no files in there, or only one? (if everything were working correctly, I would expect one and only one file to be in there.)

When you replaced the saved prefetch items, did you reset the prefetch registry key to 3? If not, then your system probably didn't even know you replaced the files and just booted oblivious to them.
 
#25 ·
When you say that the prefetch folder remained unbuilt with a setting of 2, were there absolutely no files in there, or only one? (if everything were working correctly, I would expect one and only one file to be in there.)
No files appeared - zero.

When you replaced the saved prefetch items, did you reset the prefetch registry key to 3? If not, then your system probably didn't even know you replaced the files and just booted oblivious to them.
I did not. So maybe it was just coincidence.
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top