Order Windows RegEdit Favorites Menu in Date-Ascending Order
The Favorites menu in the Windows Registry Editor (RegEdit) can be organized by date in ascending order, making it easier to find and manage frequently accessed registry keys.
Location of RegEdit Favorites
In the Windows Registry, the Favorites menu is stored at the following path:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\RegeditRegistry Key Structure
In order to sort the Favorites menu based on the date created in ascending order, you need to understand the structure of each registry key:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites]
"MRUList"="f1,f2,f3"
"f1"="@REGEDIT4\\[path\\to\\first\\favorite]"
"f2"="@REGEDIT4\\[path\\to\\second\\favorite]"
"f3"="@REGEDIT4\\[path\\to\\third\\favorite]"
The MRUList value contains a comma-separated list of the favorites, and each favorite has a unique name ("f1", "f2", etc.) which points to the actual favorite location.
Sorting Favorites Based on Date Created
To sort the Favorites menu, follow these steps:
-
Backup your current registry configuration by following the instructions at How-To Geek (offsite article).
-
Open the Registry Editor (
RegEdit). -
Navigate to:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit -
Right-click the
Favoriteskey, selectNewand thenKeyand create a new key namedDateCreated. -
Under the
DateCreatedkey, right-click on the right side and selectNewand thenString Valueand name each value with the existing favorite name (e.g.,"f1","f2"). -
Double-click each
String Valueyou created, and add the corresponding favorite's full path into theValue datafield. PressOKto save. -
Close the Registry Editor (
RegEdit). -
Run the following PowerShell script to order the Favorites in date-ascending order and update the
MRUList:# PowerShell Script to Order RegEdit Favorites by Date # Requires Windows PowerShell 5.1 or higher $registryPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" $dateCreatedKey = "$registryPath\DateCreated" $mruList = "$registryPath\MRUList" # Fetch all favorites $favorites = Get-ChildItem $registryPath # Parse favorite values $favoriteValues = foreach ($favorite in $favorites) { [PSCustomObject]@{ Path = $favorite.PSPath Name = $favorite.Name Value = (Get-ItemProperty -Path $favorite.PSPath -Name "*").PSObject.Properties | Where-Object {$_.Value -ne $null} | ForEach-Object {$_.Name} Date = Get-Date (Get-ItemProperty $dateCreatedKey.$favorite.Name -Name "DateCreated").DateCreated -Format "yyyy-MM-dd" } } # Sort favorites by date in ascending order $sortedFavorites = $favoriteValues | Sort-Object Date # Update MRUList $newMruList = $sortedFavorites | ForEach-Object {$_.Name} -Join "," # Set new MRUList value Set-ItemProperty -Path $registryPath -Name MRUList -Value $newMruListSave the script as a
.ps1file and open PowerShell as an administrator. Change the execution policy, run the script, and then restart the Registry Editor (RegEdit).Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force.\YourScript.ps1
References:
-
Article: How-To Geek - How to Back Up and Restore the Windows Registry
-
Online Resource: Microsoft - Set-ItemProperty (PowerShell Documentation)