New
#20
I think I understand what you want to do. Try the following:
Open the base directory, click on the "View" tab, and set the "Sort by" and "Group by" the way you want.
Click the drop-down arrow under "Options" at the far right of the ribbon and select "Change folder and search options" (the only choice).
On the "Folder Options" pop-up, select the "View" tab.
Click the "Apply to Folders" button.
Your chosen options should then apply to all directories of that type (pictures, I presume).
If you want to do it programmatically, you will need to find the registry keys involved. To do this:
Before performing the above changes, open RegEdit, right-click on HKEY_LOCAL_MACHINE and select "Export". Save the result as m1.reg.
Perform the modifications described above.
Go back to RegEdit, leftt-click on HKEY_LOCAL_MACHINE then press <F5> to refresh RegEdit.
Export HKEY_LOCAL_MACHINE again, saving the changed copy to m2.reg.
In Explorer, open the directory where you saved the 2 .reg files, then use a file-comparison program such as WinMerge to compare them.
The values you need to change will most likely be in HKEY_LOCAL_MACHINE \SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes, so you should look there first. Also check HKEY_LOCAL_MACHINE \SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes, as the same values probably appear there too.
And as changes of this type are usually considered to be user-specific, you should check HKEY_CURRENT_USER before-and-after first and if you don't find anything there, check HKEY_LOCAL_MACHINE.
Once you have found the registry changes you want, you can modify my code appropriately.
Last edited by SpacemanSam; 06 Apr 2022 at 22:33. Reason: Added link to https://winmerge.org/