2

I'm looking for the registry values or files in the Windows operating system that are responsible for the positioning and size of the desktop icons.

Meaning, I need to be able to arrange my windows desktop icons with certain icons on the right, left and center of the desktop. Then I need to be able to save the file or registry values that hold this information for their size and location within the desktop so that I can reload it when needed.

Whatever files or registry values hold this information I need to be able to directly manipulate them, and have it directly affect the size and positioning of the desktop icons. For example, I should be able to arrange my icons in a certain fashion, mess them up, reload the files or registry values and be able to refresh the desktop back to my desired configuration.

I've tried backing up the registry values in HKCU\software\microsoft\windows\shell\bags\1 as well as HKCU\control panel\desktop\windows metrics

After backing up those registry values I would mess up the desktop icons and then reload those registry values and the icons stayed messed up after log off/on. So I'm inclined to think that those registry values aren't the final say so as to where the icons will be positioned on the desktop.

I just need to edit a registry value or a file and SEE THE CHANGES to the desktop icons position that that makes after a log on/off so I know that's what controls that.

How can I achieve this? All of the windows forums are full of ridiculous off topic solutions that don't work or don't match my question.

5

1 Answer 1

2

HKCU\SOFTWARE\Microsoft\Windows\Shell\Bags\1\Desktop is the relevant key. Specifically, the values:

  • IconLayouts
  • IconSize

But these values are normally only read and applied when a user signs in, and written when a user signs out. The current state, including any changes made while a user is signed in, is only cached in-memory and not saved to the registry until the user signs out. If changes are made and the shell then re-started, those changes will be lost and the saved configuration reloaded. So:

  • To save an icon layout, you must sign out to execute an orderly shut down of explorer.exe that saves IconLayouts.
  • To backup a layout, sign back in and export: HKCU\SOFTWARE\Microsoft\Windows\Shell\Bags\1\Desktop
  • If your desired icon layout was in effect when you signed in, and is inadvertently altered during a session, your desired layout can be recovered by killing and restarting the shell. In PowerShell, use:
    gps explorer | spps
  • If you've saved a .reg file with a desired layout and wish to restore it, you must:
    1. Kill explorer.exe via Task Manager
    2. Merge your .reg file.
    3. Re-start explorer.exe
5
  • Thank you for your insight. I appreciate you taking the time to post this. Commented Mar 3, 2022 at 19:17
  • You're welcome. Did I answer your question or help inn your quest? If so, please upvote/mark as Answer. If you're wanting to parse/edit the (to my knowledge, undocumented) binary structure of the IconLayouts, good luck & please post your finndings! Commented Mar 3, 2022 at 22:36
  • Thanks for marking as Answer. Commented Mar 5, 2022 at 8:59
  • @evandrix: Thanks for the spelling corrections. I'm not illiterate, just legally blind and a fat-fingered typist... :D Commented Sep 6, 2022 at 2:08
  • Having come down this path, here is another post which explores parsing this format stackoverflow.com/questions/70039190/… Commented Nov 8, 2023 at 3:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .