Can't find the BagMRU Size value, my folder settings are getting lost

9

4

This is an old problem dating back to Windows XP, now on my Windows 7 64-bit system it is starting to lose folder view settings when it comes to Details, List, Icons etc, everything else is stable for position and size. I tend use details view for most things and now folders are starting to revert to icon view sometimes, not 100% of the time mind you, but seems to be more frequent the more I use the PC.

Yes I do have thousands of folders, so I think the default cache size is used up, exact same problem I had with Windows XP.

I cannot seem to find a definitive instruction on where to find the folder view cache setting in the registry for Windows 7 64-bit, there are tons of answers for XP (which I have used in the past), and Vista and some Beta/RC Windows 7.

I did find this article from Microsoft.

In the "let me fix it myself" section for Windows 7 64-bit, I don't have the sub key Local Settings under the key Wow6432Node as per Microsoft article.

HKEY_CURRENT_USER\Software\Classes\Wow6432Node\Local Settings
\Software\Microsoft\Windows\Shell\Bags

I do however have this key.

HKRU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell
\Bags and \BagsMRU

Scanning the registry for BagMRU Size values (not keys) returns no hits. I assume Windows 7 no longer uses this value by default.

Any suggestions to increase the cache size for view settings without completely resetting the entire explorer folder settings?

Does anyone have any insight to what the max stable cache size is allowed for W7? and where to change/add this value.


Edit:

I found my old notes from the Vista and XP days, I no longer have the reference link.

Windows Vista

HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell

Create a DWord 32-bit BagMRU Size and set the decimal value to 10,000 or 20,000

Sometimes folder settings get corrupted. Use regedit to view

HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell

Click on Bags and select Edit > Delete > Yes. Delete the BagMRU key as well, and restart.

Windows XP

Windows XP SP2 fix: By default SP2 has a folder cache setting of 5,000 folders to remember view settings for each folder, if you have in excess of 5,000 folders (total of all harddrives) you have to make a registry change and up it to the maximum of 8,000. to do this Start-Run-regedit and navigate to these two folders

HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell

then go to

HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam

in the right hand pane look for BagMRU size, right click modify and select decimal and set value data to 8,000. Do this in both locations, reboot to take effect.


I will experiment over the next few days and report back any enlightenment.

Moab

Posted 2011-03-21T15:43:03.870

Reputation: 54 203

I find that there are a few registry entries windows accepts that for whatever reason never get created. Just manually add the Local Settings/etc stuff per the instructions at the bottom of the article. Windows will probably start using the key as intended. Give it a while and see if the suggested value of 5000 is good enough. – CreeDorofl – 2011-04-01T02:54:15.037

5000 is default in W7 from my understanding and I have twice that many folders and more, I will try adding the values tomorrow and see if anything changes, I would still like to know the max cache value size one can use without causing problems, as I might need 15-20K. – Moab – 2011-04-01T05:29:24.023

@Moab: I suspect it to be an unsigned integer so it gets limited at 65,535 in case it's a short and 4,294,967,295 in case it's a long; if it were not unsigned it would be it's half and still sufficient for what you specify. However, please note that this is cache, I don't think that you need the information stored for 15-20K folders but only for the folders you regularly visit. I would suggest to try 10K first if 5K isn't sufficient...

– Tamara Wijsman – 2011-04-01T10:41:49.497

@Moab: As for stability, this really depends on your computer; you are just solely increasing the size the keys will take and the performance would thus depend on your hard disk, memory speed and memory usage... – Tamara Wijsman – 2011-04-01T10:44:18.950

@Tom Wijsman, Its an old problem dating back to XP, if I set it too low and open some unfrequented folders, the I lose the settings for some my most frequented, once the cache is full it starts losing the oldest cached entries. I studied the problem years back with XP, then I had the same problem with Vista, when I researched Vista a few people said 20K was the max stable, but I cannot find the link to that info anymore. Meanwhile my folder collection grows, and so does the problem. – Moab – 2011-04-01T15:01:56.647

@Moab: That's the point about a cache, if it's to low and you lose information about frequent folders then increase it. We don't know how much you use your file system or how fast your computer is so we can't tell you. Please note that a cache loses the oldest least frequent accessed cached entries, not just the oldest cached entries. We can't do more than to show you what is accessed, explain you about the 32-bit access and point out how the limit works... – Tamara Wijsman – 2011-04-01T15:17:59.313

@Moab: There isn't any verified information about the cache size, that's why you can't find it back. If you would find it it would be based on speculations anyway. Just because a value doesn't exist doesn't mean you can create the value. Also, please note that ShellNoRoam is not being accessed anymore. Another thing to try, why not set the Details view as the default folder view? – Tamara Wijsman – 2011-04-01T15:27:17.733

@Tom, so how do you set details view system wide? W7 has preset folder views based on where the folder is and what the contents are. I did notice ShellNoRoam was absent, I did not add that key, just the value BagMRU Size in 2 other keys as shown in my Vista notes. Time will tell if it has any effect. Thanks for the information. – Moab – 2011-04-01T15:36:30.343

@Moab: See this picture, you can find more information here and special cases here.

– Tamara Wijsman – 2011-04-01T15:38:55.933

I can find no solution to this problem, should I delete this question? – Moab – 2011-08-17T22:55:19.463

Answers

1

Analysis

Using Process Monitor on Windows 7 x64 I see the following when I restart explorer and randomly browse:

  • Access under
    HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags

  • Access under
    HKCU\Software\Microsoft\Windows\Shell\Bags

  • Access at
    HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU Size

    (This does not exist on my computer, but it is requested)

  • Access under
    HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU

  • Access under
    HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\Directory\OpenWithList\MRUList

    (This does not exist on my computer, but it is requested)

Conclusion

So, our %WINDIR%\Explorer.exe only accesses the 64-bit keys for our Bags.

However, the Wow6432Node keys are accessed when you use %WINDIR%\SysWOW64\explorer.exe,
there might be some contexts where the 32-bit explorer is used so take caution. For example, when it is launched from a 32-bit context or maybe when you launch Windows Explorer from a File Dialog.

To clear the Bag information, it is indeed sufficient to recreate the Bags and BagMRU folders under:

  • HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\

And although it is less used it might help to recreate the Bags folder under:

  • HKCU\Software\Microsoft\Windows\Shell\

The value of BagMRU Size is requested, so it's not really good that the key is absent. It could result in undefined behavior but I'm taking a wild guess that it just uses the default instead in the code. To be sure and run less fast into the limit you could define the DWORD value with a large number in the following key:

  • HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU Size

The last key that is accessed is when you would open a MRUList with Explorer.exe, I don't think that this is ever needed as there is no such thing as opening a Most Recently Used List other than to showing that in something like the Start Menu. So it's not necessary to create that key.

Any suggestions to increase the cache size for view settings without completely resetting the entire explorer folder settings?

I would say that you could solely create and increase the BagMRU Size setting under the assumption that your Bags settings aren't corrupt... I've answered the other question under your question.

Tamara Wijsman

Posted 2011-03-21T15:43:03.870

Reputation: 54 163

Not sure there is an answer, so I will accept yours since it did answer some questions and you did the homework using Process Monitor. – Moab – 2011-09-06T16:50:04.517

0

Indeed, that's an irritating issue. From my experience, once this cache is full, Windows doesn't remove oldest entries and just doesn't remember settings for new folders...

Good news, it seems we can increase the default of 5000 entries in Windows 7.
See this article: Fix: Windows forgets Folder View settings

  • Navigate to HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell
  • In the right side pane, "right click > New > DWORD (32-bit) Value". Name it BagMRU Size
  • For the value, select Decimal and type e.g. 10000 (or in Hexadecimal base type 2710).
  • Reboot.


The entries are stored under these two keys:

  • HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU
  • HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags

To empty the cache, you can simply delete both keys.


You may also have a look at this NirSoft utility to view the cache status: ShellBagsView.

Gras Double

Posted 2011-03-21T15:43:03.870

Reputation: 866

0

Windows 7 64-bit version uses the Wow6432 registry entry to present a separate view of HKEY_LOCAL_MACHINE\SOFTWARE for 32-bit applications that run on a 64-bit version of Windows. As you are probably using the 64-bit Explorer, I don't believe that it applies to your case.

From Changes to the size, view, icon or position of a folder are lost, to increase the limitation of folder view, try this script:

Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\BagMRU]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\Bags]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\ShellNoRoam\BagMRU]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\ShellNoRoam\Bags]
[-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU]
[-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags]
[-HKEY_CURRENT_USER\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\Bags]
[-HKEY_CURRENT_USER\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\BagMRU]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell]
"BagMRU Size"=dword:00001f40
[HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam]
"BagMRU Size"=dword:00001f40
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoSaveSettings"=dword:00000000]

If this doesn't work, have you executed all the instructions from the Microsoft article that you quoted? It contains generic instructions for Windows 7, and in addition more instructions for the 64-bits version (pertaining more to the 32-bit version of Explorer that you most probably do not use).

EDIT

I have found this MS article that seems to address your problem :
Changes to the size, view, icon or position of a folder are lost.
It also contains a FixIt that may do the work for you, but better verify after running it (in IE).

If the "BagMRU Size" as set by the FixIt is not enough, you can increase it some more. The article talks about 5000, so you may try 10000.

harrymc

Posted 2011-03-21T15:43:03.870

Reputation: 306 093

I currently have mine set to 20k in all locations, still loses some folder view settings after browsing several thousand folders (no where near 20k). W7 is a mess compared to XP with all these new folder settings "features" I could make changes to XP bagmru and it just worked. W7 remembers the settings until I browse too many folders, so it is working sort of. – Moab – 2011-08-22T15:54:31.623

That MS article is in my original post. – Moab – 2011-08-22T15:57:10.743

Oups, I thought I found a solution for you. My fear is that the "BagMRU Size" has no effect in Windows 7, so it doesn't matter what you set it to. Before deciding that, try maybe the info in this article. Also check against this other article. Note that this article claims that the BagMRU Size is limited to less than 8000.

– harrymc – 2011-08-22T16:21:55.670

8k was for XP, it can be increased to 20k in Vista and W7. Either it has no effect on purpose or is a broken/buggy feature. – Moab – 2011-08-23T18:14:44.143

Read that MS article. I found that I did not have some of the keys specified in the document, so I have now added them. Only time will tell if it works, but I suspect that it does. Previous searches reveals that one peoblem people are having is that old XP registry keys have been left in Vista and 7 and so people are putting the settings in the wrong places. Additionally, x64 windows 7 does not store the settings in the same keys either, so you need to read carefully... – None – 2012-05-04T05:43:41.673