Personalization Add Open Desktop Background File Location context menu in Windows 11


Desktop_background_banner-2.png

This tutorial will show you how to add or remove Open desktop background file location on the desktop context menu for all users in Windows 10 and Windows 11.

You can change your desktop background in Windows 11 to be a picture, solid color, a slideshow, or Windows Spotlight.

You can add a Open desktop background file location context menu to find and open directly to the image file location of your current picture, slideshow, or Windows Spotlight desktop background with the image selected.

This can make it easy to find and save the current desktop background image as wanted.


You must be signed in as an administrator to add or remove the Open desktop background file location context menu, but all users can use this context menu.



Contents

  • Option One: Add "Open desktop background file location" context menu
  • Option Two: Remove "Open desktop background file location" context menu


EXAMPLE: "Open desktop background file location" context menu, and file location examples

You will need to click/tap on Show more options first by default, then click/tap on Open desktop background file location.


Show_more_options.png
Open_desktop_background_file_location_context_menu.png

Picture_desktop_background.png
Slideshow_desktop_background.png
Windows_Spotlight_desktop_background.png





Option One

Add "Open desktop background file location" context menu


1 Click/tap on the Download button below to download the file below.

Add_Open_Desktop_Background_File_Location_context_menu.zip


2 Save the ZIP file to your desktop.

3 Unblock the ZIP file.

4 Open the ZIP file, and extract (drag and drop) the Add_Open_Desktop_Background_File_Location_context_menu.reg and Find_Desktop_Background.js files to your desktop. (see screenshot below)

(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\DesktopBackgroundFileLocation]
"icon"="imageres.dll,-5346"
@="Open desktop background file location"

[HKEY_CLASSES_ROOT\DesktopBackground\shell\DesktopBackgroundFileLocation\command]
@=hex(2):77,00,73,00,63,00,72,00,69,00,70,00,74,00,20,00,22,00,25,00,57,00,69,\
  00,6e,00,64,00,69,00,72,00,25,00,5c,00,46,00,69,00,6e,00,64,00,5f,00,44,00,\
  65,00,73,00,6b,00,74,00,6f,00,70,00,5f,00,42,00,61,00,63,00,6b,00,67,00,72,\
  00,6f,00,75,00,6e,00,64,00,2e,00,6a,00,73,00,22,00,00,00

(Contents of JS file for reference)
Code:
var HKCU = 0x80000001; // HKEY_CURRENT_USER

// Correct WMI connection
var oReg = GetObject(
    "winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdRegProv"
);

var sKeyPath = "Control Panel\\Desktop";
var sValueName = "TranscodedImageCache";

// Proper method call pattern
var oMethod = oReg.Methods_.Item("GetBinaryValue");
var oInParams = oMethod.InParameters.SpawnInstance_();

oInParams.hDefKey = HKCU;
oInParams.sSubKeyName = sKeyPath;
oInParams.sValueName = sValueName;

var oOutParams = oReg.ExecMethod_("GetBinaryValue", oInParams);

var arr = new VBArray(oOutParams.uValue).toArray();

var sContents = "";

for (var i = 24; i < arr.length; i++) {
    if (arr[i] !== 0) {
        sContents += String.fromCharCode(arr[i]);
    }
}

var shell = new ActiveXObject("WScript.Shell");
shell.Run('explorer.exe /select,"' + sContents + '"');

Open_desktop_background_file_location_context_menu-1.png

5 Perform the following steps: (see screenshots below)
  1. Open the C:\Windows folder in File Explorer (Win+E).
  2. Copy or Move the Find_Desktop_Background.js file into the C:\Windows folder.
  3. Click/tap on Continue to approve.
Open_desktop_background_file_location_context_menu-2.png
Open_desktop_background_file_location_context_menu-3.png

6 Double click/tap on the Add_Open_Desktop_Background_File_Location_context_menu.reg file to merge it.

7 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

8 You can now delete the downloaded ZIP, REG, and/or VBS files on your desktop if you like.




Option Two

Remove "Open desktop background file location" context menu


This is the default setting.


1 Click/tap on the Download button below to download the file below.

Remove_Open_desktop_background_file_location_context_menu.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\DesktopBackground\Shell\DesktopBackgroundFileLocation]

2 Save the .reg file to your desktop.

3 If you have Smart App Control turned on, you will need to unblock the downloaded REG file.

4 Double click/tap on the downloaded .reg file to merge it.

5 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

6 You can now delete the downloaded .reg file if you like.

7 Perform the following steps: (see screenshots below)
  1. Open the C:\Windows folder in File Explorer (Win+E).
  2. Delete the Find_Desktop_Background.js file in the C:\Windows folder.
  3. Click/tap on Continue to approve.
Open_desktop_background_file_location_context_menu-2.png
Open_desktop_background_file_location_context_menu-3.png


That's it,
Shawn Brink


 

Attachments

Last edited:
@Brink
I'd like to put it in your Personalize (classic) sub-menu but, I'm doing something wrong...

... never mind..., I got it! Thanks for the inspiration! ;-) (y)
 

My Computers My Computers

  • At a glance

    Windows 11 Pro
    OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    ASUS ROG Strix
  • At a glance

    Windows 11 Pro
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    ASUS VivoBook
  • ASUS VivoBook 'Lite' ~ Windows 11 Home
@Brink
I'd like to put it in your Personalize (classic) sub-menu but, I'm doing something wrong...

... never mind..., I got it! Thanks for the inspiration! ;-) (y)
:shawn:
 

My Computers My Computers

  • At a glance

    Windows 11 Pro for WorkstationsIntel i7-8700K 5 GHz64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600...ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GD...
    OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • At a glance

    Windows 11 ProSnapdragon X Elite (12 core) 3.42 GHz16 GB LPDDR5x-7467 MHz
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
After a bit of a stumble, I got it right!
Also, to make it land in the third position...

0002581.png


... I had to create a sub-flyout, so to speak, named 003.2

0002580.png
 
Last edited:

My Computers My Computers

  • At a glance

    Windows 11 Pro
    OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    ASUS ROG Strix
  • At a glance

    Windows 11 Pro
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    ASUS VivoBook
  • ASUS VivoBook 'Lite' ~ Windows 11 Home
VBS will be unfunctional in future, So today I converted all of my vbs scripts to js,

I also found that vbs in my computer and wanted to convert that too (with help of ChatGPT for this one)

here is js version of Find_Desktop_Background.vbs

save it as Find_Desktop_Background.js

Code:
var HKCU = 0x80000001; // HKEY_CURRENT_USER

// Correct WMI connection
var oReg = GetObject(
    "winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdRegProv"
);

var sKeyPath = "Control Panel\\Desktop";
var sValueName = "TranscodedImageCache";

// Proper method call pattern
var oMethod = oReg.Methods_.Item("GetBinaryValue");
var oInParams = oMethod.InParameters.SpawnInstance_();

oInParams.hDefKey = HKCU;
oInParams.sSubKeyName = sKeyPath;
oInParams.sValueName = sValueName;

var oOutParams = oReg.ExecMethod_("GetBinaryValue", oInParams);

var arr = new VBArray(oOutParams.uValue).toArray();

var sContents = "";

for (var i = 24; i < arr.length; i++) {
    if (arr[i] !== 0) {
        sContents += String.fromCharCode(arr[i]);
    }
}

var shell = new ActiveXObject("WScript.Shell");
shell.Run('explorer.exe /select,"' + sContents + '"');

You have to modify that too "HKEY_CLASSES_ROOT\DesktopBackground\Shell\DesktopBackgroundFileLocation\command"
 

My Computer My Computer

At a glance

Windows 11 25H2 Home Single Language (26200.8...Intel Core i3-1115G48GBon-board
OS
Windows 11 25H2 Home Single Language (26200.8037)
Computer type
Laptop
Manufacturer/Model
LENOVO IdeaPad 5 15ITL05
CPU
Intel Core i3-1115G4
Motherboard
There is no such a God, I only know mother-Earth
Memory
8GB
Graphics Card(s)
on-board
Sound Card
on-board
Monitor(s) Displays
(s) is too ambitious for me
Screen Resolution
1920*1080
Hard Drives
256GB (SSD)
PSU
I was very young when I last saw a PSU
Case
...
Cooling
My coldness is enough to cool the computer
Keyboard
A broken and very clean keyboard
Mouse
Rat
Internet Speed
Slowest internet connection in Europe
Browser
ChromePortable / FirefoxPortable / TorBrowser
Antivirus
G-Virus
Other Info
I can simply say that I took the red pill and I am not happy with it.
Thank you @Feuer. The tutorial has been updated to use the JS file instead of VBS file. :shawn:
 

My Computers My Computers

  • At a glance

    Windows 11 Pro for WorkstationsIntel i7-8700K 5 GHz64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600...ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GD...
    OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • At a glance

    Windows 11 ProSnapdragon X Elite (12 core) 3.42 GHz16 GB LPDDR5x-7467 MHz
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender

Latest Support Threads

Back
Top Bottom