Where do Windows XP/Vista/7/… save the positions of the icons on the desktop? Is there a built-in way to save the positions? Can I lock the position of certain items?
Windows – Where Are Icon Positions Stored?
iconslockwindows
Related Solutions
You can simply right-click the Desktop & click Refresh. This saves the icon positions (at least it does on XP, also confirmed on Windows 7).
Here's a simple way to confirm that this method works:
- Move an icon
- Kill
explorer.exe
(& restart it, if it doesn't auto-restart) - Notice icon moves back (because it wasn't saved)
- Move icon again
- Right-click on the Desktop -> click Refresh
- Kill
explorer.exe
(& restart) - Notice icon doesn't move back (since this time it was saved before killing explorer)
You've pretty much answered your own question, by the looks of it. It is a combination of things, but the saved settings are at the registry key noted.
The Windows registry is actually a combination of several files found in the %windir%\System32\Config folder: Software, System, SAM, Security, Default, and UserDiff. The NTUSER.DAT file is the only registry file not so located; it is in %userprofile% as you noted.
Desktop.ini does some save settings for the desktop, but not the ordering; it is only created if you have enabled "save each folder's view settings". Here is typical content:
[.ShellClassInfo] LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769 IconResource=%SystemRoot%\system32\imageres.dll,-183 [LocalizedFileNames] VAIO Control Center.lnk=@C:\PROGRA~2\Sony\VAIOCO~\VAIOCO~1.EXE,-1319
There is further info on what you can incorporate into desktop.ini at http://msdn.microsoft.com/en-us/library/windows/desktop/cc144102%28v=vs.85%29.aspx
=========
But the last order "remembered", for icon arrangement, is shown primarily based on the information you mentioned as in the registry at HKCU\Software\Microsoft\Windows\Shell\Bags\1\Desktop
As you note, this key is stored in NTUSER.DAT for the individual user, and then incorporated into the registry as HKCU...
So when you did your restore, you likely restored NTUSER.DAT and thus got back the order that you last used.
Best Answer
They are located in the registry under
HKCU\Software\Microsoft\Windows\Shell\Bags\1\Desktop
.The key that should interest you is the ItemPosXXXxXXX(where XXX is your resolution).
The relevant values are
Mode
,LogicalViewMode
,IconSize
.You can combine them as shown in the table:
Update
Fortunately found an article that can help you. See:
Windows Shellbag Forensics
.