Solved Removing 'Bitmap image' from 'New' context menu...


Based on all the info posted so far & my own experiments, I think that the Context menu, New, Bitmap image entry can be removed automatically using a batch file that calls NirSoft RegScanner.
I've used more time than I had intended on this and I've got to go because my stomach is now convinced that my throat has been cut and is demanding retribution.

I've only experimented with Stage 1 so far but I've added comments about the later Stages below so you can understand what I'm on about.

Stage 1 These commands, which need to be run as Admin, produce readily readable output files. Either could be considered, one might turn out to be easier to work with in the sub-routine within Stage 2.
RegScanner.exe /cfg "H:\TestFolder\regscanner.cfg" /stext "H:\TestFolder\STXTOutput.txt"
RegScanner.exe /cfg "H:\TestFolder\regscanner.cfg" /sxml "H:\TestFolder\sxmlOutput.xml"
Both commands produce an output that identifies the Registry Key & Name entry/entries that need to be worked on in this particular computer.
- A manual run of the RegScanner.exe user interface is needed beforehand so an initial, generic, default Cfg file can be saved & copied to a convenient folder.​
- Then, a specific Cfg file needs to be saved when running the RegScanner user interface to include the ShellNewDisplayName_Bmp search term & selecting only the HKCR Registry Hive.​
- That specific Cfg file can then be copied to, say, the folder that the batch file is to be run from.​
- The initial, generic, default Cfg file can then be copied back to the RegScanner folder so that the tool not condemned to always run the search required for this particular job. [I think merely deleting all Cfg files from the RegScanner.exe folder will also achieve the same end.]​

Stage 2 The output file can be read using a For command in the form
For /f "usebackq tokens=*" %%X in ("%SourceFile%") do Call :Processing "%%X"
in which the Processing sub-routine
- checks that results have been obtained [my Win11-upgraded-from-Win10 computer does not have any of these HKCR Keys so will return no real results].​
- checks that the rest of the Data : entry in both Keys are not blank or, for the xml version, that the <data/> entry exists in both because they mean the job had already been done​
- if the job has not already been done for either entry, extracts the Registry Key : or <registry_key> lines and the Name : or <name> lines then tidies up those values by removing superfluous text from them.​
It is use of the For command that allows the script to cope with both single & multiple HKCR Keys in the results.
- I always use sub-routines for processing For command results. I find this makes for code that can be developed incrementally, that can be experimented with safely, that is readily understandable and that is straightforwards to debug.

Stage 3 The single or multiple Registry key & Name entries are then used in a Reg Delete command that removes the Data entry for the found Keys-Names.


I don't know when I will have time to return to this topic.
  • I don't feel like treating this as a high priority but I do believe it is all feasible.
  • I really do not like using intermediate files such as the .txt / .xml files generated in Stage 1 but that's how the NirSoft RegScanner tool is designed to work in its command line mode.
  • I use scripts that can be run in Windows 10 & 11 without alternation so, for this one, I'd add in an OS check at the start so I can escape if the OS is Windows 10.
  • I store all my scripts, such as this batch file, and all my portable utilities, such as RegScanner, within subfolders of C:\Tools, a folder I create on all my computers for this purpose. Set up my C:\Tools folder - TenForums



All the best,
Denis
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3447
@Try3

"I don't feel like treating this as a high priority ...."

You've got that right. I think the amount of work you've put into this is above and beyond.

Thanks for the research and the write-up. It'll be easy with your instructions, if anyone cares enough to actually do it.
 

My Computers

System One System Two

  • OS
    11 Pro 24H2 26100.2454
    Computer type
    PC/Desktop
    Manufacturer/Model
    Lenovo ThinkCentre M920S SFF
    CPU
    i7-9700 @ 3.00GHz
    Motherboard
    Lenovo 3132
    Memory
    32GBDDR4 @ 2666MHz
    Graphics Card(s)
    Intel HD 630 Graphics onboard
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    LG E2442
    Screen Resolution
    1920x1080
    Hard Drives
    1 x Samsung 970 EVO PLUS 500GB NVMe SSD, 1 x WD_BLACK SN770
    250GB NVMe SSD (OS and programs), 1 x WD_BLACK SN770
    500GB NVMe SSD (Data)
    Case
    Lenovo SFF
    Keyboard
    Cherry Stream TKL JK-8600US-2 Wired
    Mouse
    LogiTech M510 wireless
    Internet Speed
    Fast (for fixed wireless!)
    Browser
    Chrome, sometimes Firefox
    Antivirus
    Malwarebytes Premium & Defender (working together beautifully!)
  • Operating System
    11 Pro 24H2 26100.2454
    Computer type
    PC/Desktop
    Manufacturer/Model
    Lenovo ThinkCentre M920S SFF
    CPU
    i5-8400 @ 2.80GHz
    Motherboard
    Lenovo 3132
    Memory
    32GB DDR4 @ 2600MHz
    Graphics card(s)
    Intel HD 630 Graphics onboard
    Sound Card
    Realtek High Definition Audio onboard
    Monitor(s) Displays
    LG FULL HD (1920x1080@59Hz)
    Screen Resolution
    1920 x 1080
    Hard Drives
    1 x Samsung 970 EVO PLUS NVMe; 1 x Samsung 980 NVMe SSD
    Case
    Lenovo Think Centre SFF
    Mouse
    LogiTech M510 wireless
    Keyboard
    Cherry Stream TKL JK-8600US-2 Wired
    Internet Speed
    Fast (for fixed wireless!)
    Browser
    Chrome
    Antivirus
    Malwarebytes Premium and MS Defender, beautiful together
Dear Panaho,

Thanks for your explanation on how to remove the "Bitmap image" from the 'New' context menu on my Windows 11.
It works for me!
Best regards,

Johan.
 

My Computer

System One

  • OS
    Windows 11
It works for me!
I think you mean the method in post #71.
It also worked for me but do note the ensuing discussion that established that there can be two entries that match what panaho searched for and either could be the one that needs to be removed [removing both instances seems to be safe].


All the best,
Denis
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3447
Denis,

Yes, I mean the method in post#73.
I Indeed found 2 entries for the "ShellNewDisplayName_Bmp", and I both cleared them.

Johan.
 

My Computer

System One

  • OS
    Windows 11
I never understood why anyone would need to create a blank bitmap file on their desktop!?!?!? 🤷‍♂️
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    ASUS ROG Strix
  • Operating System
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    ASUS VivoBook
@Try3 and @Johan99

You both meant post #71, not post #73, which is Denis's routine (and very valuable) advice to newcomers to this forum. Post #71 is the corrected version of the very simple procedure. Panaho had made a typing mistake in his original write-up of the procedure, and corrected it (with a little help from his friends).
 

My Computers

System One System Two

  • OS
    11 Pro 24H2 26100.2454
    Computer type
    PC/Desktop
    Manufacturer/Model
    Lenovo ThinkCentre M920S SFF
    CPU
    i7-9700 @ 3.00GHz
    Motherboard
    Lenovo 3132
    Memory
    32GBDDR4 @ 2666MHz
    Graphics Card(s)
    Intel HD 630 Graphics onboard
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    LG E2442
    Screen Resolution
    1920x1080
    Hard Drives
    1 x Samsung 970 EVO PLUS 500GB NVMe SSD, 1 x WD_BLACK SN770
    250GB NVMe SSD (OS and programs), 1 x WD_BLACK SN770
    500GB NVMe SSD (Data)
    Case
    Lenovo SFF
    Keyboard
    Cherry Stream TKL JK-8600US-2 Wired
    Mouse
    LogiTech M510 wireless
    Internet Speed
    Fast (for fixed wireless!)
    Browser
    Chrome, sometimes Firefox
    Antivirus
    Malwarebytes Premium & Defender (working together beautifully!)
  • Operating System
    11 Pro 24H2 26100.2454
    Computer type
    PC/Desktop
    Manufacturer/Model
    Lenovo ThinkCentre M920S SFF
    CPU
    i5-8400 @ 2.80GHz
    Motherboard
    Lenovo 3132
    Memory
    32GB DDR4 @ 2600MHz
    Graphics card(s)
    Intel HD 630 Graphics onboard
    Sound Card
    Realtek High Definition Audio onboard
    Monitor(s) Displays
    LG FULL HD (1920x1080@59Hz)
    Screen Resolution
    1920 x 1080
    Hard Drives
    1 x Samsung 970 EVO PLUS NVMe; 1 x Samsung 980 NVMe SSD
    Case
    Lenovo Think Centre SFF
    Mouse
    LogiTech M510 wireless
    Keyboard
    Cherry Stream TKL JK-8600US-2 Wired
    Internet Speed
    Fast (for fixed wireless!)
    Browser
    Chrome
    Antivirus
    Malwarebytes Premium and MS Defender, beautiful together
You both meant post #71, not post #73
Yes, post #71. Thanks. I got the link right but not the text.
I have obviously not had enough Cointreau today so I'll logoff and deal with that problem right now.

Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3447
You're welcome, and I'm jealous. It's only soon-after-lunch here, so I'm going to exercise some will power until it's 5:00 (well, in Newfoundland).
 

My Computers

System One System Two

  • OS
    11 Pro 24H2 26100.2454
    Computer type
    PC/Desktop
    Manufacturer/Model
    Lenovo ThinkCentre M920S SFF
    CPU
    i7-9700 @ 3.00GHz
    Motherboard
    Lenovo 3132
    Memory
    32GBDDR4 @ 2666MHz
    Graphics Card(s)
    Intel HD 630 Graphics onboard
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    LG E2442
    Screen Resolution
    1920x1080
    Hard Drives
    1 x Samsung 970 EVO PLUS 500GB NVMe SSD, 1 x WD_BLACK SN770
    250GB NVMe SSD (OS and programs), 1 x WD_BLACK SN770
    500GB NVMe SSD (Data)
    Case
    Lenovo SFF
    Keyboard
    Cherry Stream TKL JK-8600US-2 Wired
    Mouse
    LogiTech M510 wireless
    Internet Speed
    Fast (for fixed wireless!)
    Browser
    Chrome, sometimes Firefox
    Antivirus
    Malwarebytes Premium & Defender (working together beautifully!)
  • Operating System
    11 Pro 24H2 26100.2454
    Computer type
    PC/Desktop
    Manufacturer/Model
    Lenovo ThinkCentre M920S SFF
    CPU
    i5-8400 @ 2.80GHz
    Motherboard
    Lenovo 3132
    Memory
    32GB DDR4 @ 2600MHz
    Graphics card(s)
    Intel HD 630 Graphics onboard
    Sound Card
    Realtek High Definition Audio onboard
    Monitor(s) Displays
    LG FULL HD (1920x1080@59Hz)
    Screen Resolution
    1920 x 1080
    Hard Drives
    1 x Samsung 970 EVO PLUS NVMe; 1 x Samsung 980 NVMe SSD
    Case
    Lenovo Think Centre SFF
    Mouse
    LogiTech M510 wireless
    Keyboard
    Cherry Stream TKL JK-8600US-2 Wired
    Internet Speed
    Fast (for fixed wireless!)
    Browser
    Chrome
    Antivirus
    Malwarebytes Premium and MS Defender, beautiful together
BMP

WIN + R
Write "regedit"
Enter
CTRL+F
Write "ShellNewDisplayName_Bmp"
Enter
Find @{Microsoft.Paint_()...()_x64__8wekyb3d8bbwe? ms-resource://Microsoft.Paint/Resources/ShellNewDisplayName_Bmp}
Context menu
Modify
Delete "Value data"


TXT

WIN + R
Write "regedit"
Enter
CTRL+F
Write "/ShellNewDisplayName_Txt"
Enter
Find @{Microsoft.Paint_()...()_x64__8wekyb3d8bbwe? ms-resource://Microsoft.Paint/Resources/ShellNewDisplayName_Bmp}
Context menu
Modify
Delete "Value data"


It works for me :wink:


Regards.

It took me a long time to find this! Thanks.

FYI, I had no txt entry. Probably because I uninstall notepad right after installing windows. They ruined it. I used the old fashioned way to add a shellnew key to .txt and pointed it to notepad++. Worked fine.
 

My Computers

System One System Two

  • OS
    Windroid 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    Intel Core i9-14900K Raptor Lake Refreshed 6.0 GHZ
    Motherboard
    MSI MAG Z790 Tomahawk WiFi
    Memory
    32GB (2x16) GSKILL Trident Z5 RGB Series (Intel XMP 3.0) DDR5 RAM 6700MT/s
    Graphics Card(s)
    MSI Gaming GeForce RTX 4070 12GB
    Sound Card
    Onboard Realtek® ALC4080 Codec
    Monitor(s) Displays
    Monitor #1 Samsung Odyssey G50A WQHD G-Sync HDR10 Monitor #2 HP LA1911
    Screen Resolution
    2560x1440 and 1280x1024
    Hard Drives
    Samsung 980 PRO SSD 1TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (150GB System / 850GB More Games)
    Crucial CT2000MX500SSD1 2TB (Games)
    Western Digital Green WD40EZRX 4TB (Data/Backup)
    Western Digital Blue WD60EZAZ 6TB (Storage)
    Western Digital Blue WD60EZAZ 6TB (Media)
    PSU
    Rosewill Hive-750S
    Case
    Cooler Master Elite 430 Mid Tower
    Cooling
    Cooler Master ML240L V2 Liquid CPU cooler + 3x120mm in + Isolated PSU Standard upward flow
    Keyboard
    Microsoft Natural Elite White PS/2 (with usb adapter)
    Mouse
    Microsoft D67-00001 Trackball Optical Mouse (rebuilt with ceramic bearings)
    Internet Speed
    450Mb/s hard wired
    Browser
    Edge, FF, Tor
    Antivirus
    Win Def
    Other Info
    Razer Tartarus V2 Gaming Keypad
    Logitech Z-5500 5.1 THX 505w (Orignal 10" Sub with (Fr, Rr, Ctr) Polk Audio satellites
  • Operating System
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    Intel Core i9-14900K Raptor Lake Refreshed 6.0 GHz FCLGA1700 (Gen 14)
    Motherboard
    MSI MAG Z790 Tomahawk WiFi
    Memory
    32GB (2x16) GSKILL Trident Z5 RGB Series (Intel XMP 3.0) DDR5 RAM 6700MT/s
    Graphics card(s)
    MSI Gaming GeForce RTX 3060Ti 8GB
    Sound Card
    Onboard Realtek® ALC4080 Codec
    Monitor(s) Displays
    Monitor #1 Samsung Odyssey G50A WQHD G-Sync HDR10 Monitor #2 Samsung TU7000 55" TV
    Screen Resolution
    2560x1440 and 3840x2160
    Hard Drives
    Samsung 980 PRO SSD 1TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (System)
    Samsung 980 PRO SSD 2TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (Games)
    Crucial CT1000MX500SSD1 1TB (More Games)
    WD Green WD20EZRX 2TB (Data/Backup)
    WD Blue WD60EZAZ 6TB (Media)
    PSU
    Rosewill Hive-750S
    Case
    Cooler Master N400 NSE-400-KKN2 Mid-Tower
    Cooling
    Cooler Master ML240L V2 Liquid CPU cooler + 3x120mm in + 2x120mm + Isolated PSU Reverse flow front exhaust
    Mouse
    MSI G20 Elite and Logitech MK345 Wireless
    Keyboard
    Logitech MK345 Wireless
    Internet Speed
    350Mb/s hard wired
    Browser
    FF
    Antivirus
    Win Def
    Other Info
    Razer Tartarus Gaming Keypad
    MSI GC30 Gaming Controller (Xbox style)
It took me a long time to find this! Thanks.

FYI, I had no txt entry. Probably because I uninstall notepad right after installing windows. They ruined it. I used the old fashioned way to add a shellnew key to .txt and pointed it to notepad++. Worked fine.
That's the broken version, it's looking for a bmp entry where it should be looking for txt in the second section.
 

My Computer

System One

  • OS
    WIN 11 Pro 24H2 - 26100.3323
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom Build
    CPU
    Intel XEON E5-2699 v3
    Motherboard
    ASUS X99-A
    Memory
    64GB Teamgroup UD4-3600
    Graphics Card(s)
    NVIDIA GeForce GTX 1080 Ti
    Sound Card
    Integrated
    Monitor(s) Displays
    ACER X34 Predator
    Screen Resolution
    3440 x 1440
    Hard Drives
    Crucial CT1000P 3P SSD8 1TB
    Crucial CT1000 BX500 SSD 1TB
    PSU
    GameMax Pro
    Case
    Fractal Design
    Cooling
    Corsair H110iGT + 6 140mm Fans
    Keyboard
    Corsair K4
    Mouse
    G-Skill G502
    Internet Speed
    50MBs
    Browser
    Chrome
    Antivirus
    OEM
That's the broken version, it's looking for a bmp entry where it should be looking for txt in the second section.
Yeah, i saw that. It was just the .bmp I was fighting with. The info here let me win.
 

My Computers

System One System Two

  • OS
    Windroid 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    Intel Core i9-14900K Raptor Lake Refreshed 6.0 GHZ
    Motherboard
    MSI MAG Z790 Tomahawk WiFi
    Memory
    32GB (2x16) GSKILL Trident Z5 RGB Series (Intel XMP 3.0) DDR5 RAM 6700MT/s
    Graphics Card(s)
    MSI Gaming GeForce RTX 4070 12GB
    Sound Card
    Onboard Realtek® ALC4080 Codec
    Monitor(s) Displays
    Monitor #1 Samsung Odyssey G50A WQHD G-Sync HDR10 Monitor #2 HP LA1911
    Screen Resolution
    2560x1440 and 1280x1024
    Hard Drives
    Samsung 980 PRO SSD 1TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (150GB System / 850GB More Games)
    Crucial CT2000MX500SSD1 2TB (Games)
    Western Digital Green WD40EZRX 4TB (Data/Backup)
    Western Digital Blue WD60EZAZ 6TB (Storage)
    Western Digital Blue WD60EZAZ 6TB (Media)
    PSU
    Rosewill Hive-750S
    Case
    Cooler Master Elite 430 Mid Tower
    Cooling
    Cooler Master ML240L V2 Liquid CPU cooler + 3x120mm in + Isolated PSU Standard upward flow
    Keyboard
    Microsoft Natural Elite White PS/2 (with usb adapter)
    Mouse
    Microsoft D67-00001 Trackball Optical Mouse (rebuilt with ceramic bearings)
    Internet Speed
    450Mb/s hard wired
    Browser
    Edge, FF, Tor
    Antivirus
    Win Def
    Other Info
    Razer Tartarus V2 Gaming Keypad
    Logitech Z-5500 5.1 THX 505w (Orignal 10" Sub with (Fr, Rr, Ctr) Polk Audio satellites
  • Operating System
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    Intel Core i9-14900K Raptor Lake Refreshed 6.0 GHz FCLGA1700 (Gen 14)
    Motherboard
    MSI MAG Z790 Tomahawk WiFi
    Memory
    32GB (2x16) GSKILL Trident Z5 RGB Series (Intel XMP 3.0) DDR5 RAM 6700MT/s
    Graphics card(s)
    MSI Gaming GeForce RTX 3060Ti 8GB
    Sound Card
    Onboard Realtek® ALC4080 Codec
    Monitor(s) Displays
    Monitor #1 Samsung Odyssey G50A WQHD G-Sync HDR10 Monitor #2 Samsung TU7000 55" TV
    Screen Resolution
    2560x1440 and 3840x2160
    Hard Drives
    Samsung 980 PRO SSD 1TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (System)
    Samsung 980 PRO SSD 2TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (Games)
    Crucial CT1000MX500SSD1 1TB (More Games)
    WD Green WD20EZRX 2TB (Data/Backup)
    WD Blue WD60EZAZ 6TB (Media)
    PSU
    Rosewill Hive-750S
    Case
    Cooler Master N400 NSE-400-KKN2 Mid-Tower
    Cooling
    Cooler Master ML240L V2 Liquid CPU cooler + 3x120mm in + 2x120mm + Isolated PSU Reverse flow front exhaust
    Mouse
    MSI G20 Elite and Logitech MK345 Wireless
    Keyboard
    Logitech MK345 Wireless
    Internet Speed
    350Mb/s hard wired
    Browser
    FF
    Antivirus
    Win Def
    Other Info
    Razer Tartarus Gaming Keypad
    MSI GC30 Gaming Controller (Xbox style)
Hi All,

did anyone figured out how to remove 'Bitmap image' from 'New' context menu?

Old Windows 10 registry tweak does not seems work anymore...

Thanks.

Hey.
That works for me. But i delete more than 1 same keys.
 

My Computer

System One

  • OS
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion 17 cd2205nw
    CPU
    Intel 113700H
    Memory
    16GB
    Graphics Card(s)
    NVIDIA RTX 3050 ti
    Screen Resolution
    1980x1020
    Hard Drives
    Micron 512GB
    Mouse
    Logitech
    Internet Speed
    100Mbs
    Browser
    Vivaldi , Edge
    Antivirus
    Norton Plus
I used O&O RegEditor > My Computer > Ctrl-F > ShellNewDisplayName_Bmp > for each entry, right-click > Edit > remove "Bitmap image" from the Data line. Actually, removing that from one such entry seems to have automatically removed it from the other as well.

The results (i.e., no data) took a minute (or maybe a refresh or re-search) to appear in O&O. But that did remove the context menu option immediately.
 
Last edited:

My Computer

System One

  • OS
    Windows 10 & 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Various homebuilt
In practice the registry value you are looking for will be found under
HKCU\Software\Classes\Local Settings\MrtCache The key immediately under MrtCache is the full pathname of 'CachedMergedResourcesPriFileName' which is found in the installation of Paint. All the \ characters are replaced with %5C to make the key name legal. This file path contains the current version number of Paint, and changes with each update. The basic App package name of microsoft.paint_8wekyb3d8bbwe doesn't change. The current installation folder can be found indirectly via "HKCU\Software\RegisteredApplications\PackagedApps".

I've put togeher a very simple vbScript that displays the current ShellNewDisplayName, or if given a single parameter changes it. It works out the CachedMergedResourcesPriFileName, so the search underneath ids very simple. If you set it to an empty string "" then 'Bitmap Image' dissappears from the New Context menu. I don't know how generalised it is, but it works just as well to change 'New Text Document' provided by the new Notepad App.

It's perfectly possible that the CachedMergedResourcesPriFileName can be found more easily using powershell, which certainly has various methods for working with Apps.

Mike
Code:
' finding (and changing) the shellnew key for managed apps
' the (grandparent) key looks like this:
' HKCU\Software\Classes\Local Settings\MrtCache\C:%5CProgram Files%5CWindowsApps%5CMicrosoft.WindowsNotepad_11.2401.26.0_x64__8wekyb3d8bbwe%5Cmicrosoft.system.package.metadata%5CS-1-5-21-4080321234-480219373-812125678-1002-MergedResources-0.pri
' there are subkeys with apparently random numerical names underneath this.

' that grandparent subkey is the full path name of the CachedMergedResourcesPriFileName.
' The \ characters which aren't allowed in key names are replaced with %5C.

' from the appName:
' via "Software\RegisteredApplications\PackagedApps" we can find the \App\Capabilities key
' The "PackageRootFolder" value can be found two subkeys higher
' The CachedMergedResourcesPriFileName is stored under a version independent key

'appName = "Microsoft.WindowsNotepad_8wekyb3d8bbwe"
appName = "microsoft.paint_8wekyb3d8bbwe"

If WScript.Arguments.Count > 1 Then
    WScript.Echo " only 1 (optional) argument allowed"
    WScript.Quit
End If   

Const dQuote = """"

Const HKEY_CURRENT_USER = &H80000001

Set oReg = GetObject("winmgmts://./root/default:StdRegProv")

packagedApps = "Software\RegisteredApplications\PackagedApps"

oReg.GetStringValue HKEY_CURRENT_USER, packagedApps, appName & "!App", appInfo

' remove \App\Capabilities

appInfo = Replace(Appinfo, "\App\Capabilities", "")

oReg.GetStringValue HKEY_CURRENT_USER, appInfo, "PackageRootFolder", appRoot

appRoot = Replace(appRoot, "\", "%5C")

' the CachedMergedResourcesPriFileName is found under a key like this:
' HKCU\Software\classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.windowsnotepad_8wekyb3d8bbwe\ResourcesConfig

ResourcesConfig = "Software\classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\" & appName & "\ResourcesConfig"
oReg.GetStringValue HKEY_CURRENT_USER, ResourcesConfig, "CachedMergedResourcesPriFileName", ResourcesPriFileName

'wscript.echo ResourcesConfig
'wscript.echo ResourcesPriFileName

resourceKey = "Software\Classes\Local Settings\MrtCache\" & appRoot & "%5Cmicrosoft.system.package.metadata%5C" & ResourcesPriFileName

'WScript.echo resourceKey

' recursive search for value containing "ShellNewDisplayName"
EnumerateKeys HKEY_CURRENT_USER, resourceKey

Sub EnumerateKeys(hive, key)
    ' WScript.Echo key
    ' first look for value in current key
    oReg.EnumValues HKEY_CURRENT_USER, key, arrValueNames, arrValueTypes
    If IsArray(arrValueNames) Then
        For i = 0 To UBound(arrValueNames)
            If InStr(1,  arrValueNames(i), "ShellNewDisplayName", 1) Then
                WScript.Echo "Value Name: " & arrValueNames(i)
                If WScript.Arguments.Count = 1 Then
                    oReg.SetStringValue HKEY_CURRENT_USER, key, arrValueNames(i), WScript.Arguments.Item(0)
                End If
                oReg.GetStringValue HKEY_CURRENT_USER, key, arrValueNames(i), data
                WScript.echo "Value Data: " & dQuote & data & dQuote
            End If
        Next
    End If
    ' now look for subkeys to process
    oReg.EnumKey hive, key, arrSubKeys
    If Not IsNull(arrSubKeys) Then
        For Each subkey In arrSubKeys
            EnumerateKeys hive, key & "\" & subkey
        Next
    End If
End Sub

You'll need to run the script from a command prompt using cscript
 

My Computer

System One

  • OS
    Windows 11 23H2 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    i3-1215U
    Memory
    8GB
    Monitor(s) Displays
    Dell S2721
    Screen Resolution
    3840x2160
    PSU
    External 65W
    Keyboard
    Cherry mechanical (Blue)
    Mouse
    Microsoft
    Browser
    FireFox
    Antivirus
    MS

Latest Support Threads

Back
Top Bottom