148

There is another question on here that allows users to find the path to their current background image through a cmd command.

How could I find out the path to the current desktop image?

In Windows 10 this no longer works. It only returns the first image in the folder, it does not change with the backgrounds as they transition. I need a similar command that returns the path(s) to the current image on the desktop background(s) that actually works in Windows 10 if one exists.

1
  • superuser.com is apparently a service that doesn't allow just anybody to answer questions. i'll just add this as a comment. in my version of windows 10 none of the registry paths in these answers existed. however, i did find a history of the wallpapers at HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers. This let me find the directory I needed to recover.
    – Coda
    Mar 23, 2023 at 4:03

8 Answers 8

234
+50

A copy of the current wallpaper can be found by entering one of the below paths in Windows File Explorer address bar.

Path 1 -
%AppData%\Microsoft\Windows\Themes\CachedFiles

Path 2 -
%AppData%\Microsoft\Windows\Themes\TranscodedWallpaper

Note: The file TranscodedWallpaper in Path 2 does not have a file extension. Use "Open With" or "How do you want to open this file?" dialogue box and select any image viewer, such as, "Windows Photo Viewer" or the "Photos" app.

Note for Windows 10: The above locations have limitations. For example, if the wallpaper you’re looking for is no longer visible in the ‘Background’ tab in the Settings app, you can’t recover it. It will work for your last five wallpapers but nothing older. 1


Path 3 [default Windows wallpapers] -
%SystemRoot%\Web

Check in one of the below folders -

  • "4K" for 4K wallpapers,
  • "Screen" for lock screen backgrounds,
  • "touchkeyboard" for colorful abstract backdrops in Windows 11 2
  • "Wallpapers" for default Windows wallpapers

Path 4 [wallpapers from installed themes (Aero, etc.)] -
%SystemRoot%\Resources\Themes

Path 5 [wallpapers from per-user installed themes (including pre-installed from OEM)] -
%LocalAppData%\Microsoft\Windows\Themes

Path 6 [if Windows Photo Viewer was used to set desktop wallpaper] -
%AppData%\Microsoft\Windows Photo Viewer\


Path 7 -
If Windows 11 Slideshow was used to set desktop background Windows 11 Slideshow

The location of the image is stored in the windows registry in folder HKEY_CURRENT_USER\Control Panel\Desktop under the key TranscodedImageCache but is unfortunately encoded in binary.

To decode the registry key and view the image in Windows Explorer, you may follow the instructions listed on ElevenForum.com or use Notepad to save the vbs code mentioned below in a .vbs file and run it.

The contents of VBS file used for decoding for reference 4

Const HKCU = &H80000001 'HKEY_CURRENT_USER

sComputer = "."  

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
            & sComputer & "\root\default:StdRegProv")

sKeyPath = "Control Panel\Desktop\"
sValueName = "TranscodedImageCache"
oReg.GetBinaryValue HKCU, sKeyPath, sValueName, sValue


sContents = ""

For i = 24 To UBound(sValue)
  vByte = sValue(i)
  If vByte <> 0 And vByte <> "" Then
    sContents = sContents & Chr(vByte)
  End If
Next

CreateObject("Wscript.Shell").Run "explorer.exe /select,""" & sContents & """"

Note: The vbs code didn't work for me when I first set up the slideshow, but it worked after changing to the next image in the slideshow


If you are looking for the location of Lock Screen images, visit this SuperUser question.

Note on 3rd party apps - When 3rd party apps like John's Background Switcher are used to manage desktop backgrounds (which I used on my older Win10 PC), they typically provide an option to view the current/previous desktop background (if set by the app itself). Check the app's help file to know more.

Bonus: To activate Windows Photo Viewer in Windows 10 visit this article on HowToGeek

2
  • 2
    This method doesn't provide the location of the original photo, but rather the copy that Windows makes in preparation for display. Oct 26, 2018 at 16:06
  • 1
    @Edward Brey - Use John's Background Switcher (or several other switchers/downloaders) to switch wallpapers and to find original location. To the best of my knowledge, Windows 10 does not natively support it. Maybe raise it as a feature request in Microsoft Feedback
    – xypha
    Nov 2, 2018 at 10:41
28

I have Windows 10, version 1709. One of the other answers got me looking in the registry and I found exactly what I needed in clear text at

HKEY_CURRENT_USER\Control Panel\Desktop\WallPaper

No decoding needed.

1
  • I use Bing Desktop to change wallpapers. I was able to find the path to those wallpaper images using this. Thanks!
    – anacron
    Nov 22, 2018 at 6:59
11

Windows 8 and 10 still store the original path of the current background image - rather than the cached / transcoded file as in xypha's answer:

HKEY_CURRENT_USER\Control Panel\Desktop\TranscodedImageCache

Microsoft doesn't want things to be easy though: this isn't plain text so you have to decode it from binary.

The Winhelponline website has compiled a couple of scripts (VBA and PowerShell) which can print the image name, and launch Explorer to point to the image file.

http://www.winhelponline.com/blog/find-current-wallpaper-file-path-windows-10/

2
  • 1
    This does not work with multiple displays. Unverified with a single display.
    – cujo
    May 2, 2017 at 2:18
  • This worked great - I had a random wallpaper and couldn't figure out which source image it was. The value seems to be binary/unicode, my path was in ascii so I just had to read every other letter.
    – dhiltonp
    Sep 5, 2022 at 23:41
5

To get the "Transcoded" PATH in cleartext, do this in PowerShell:

$TIC=(Get-ItemProperty 'HKCU:\Control Panel\Desktop' TranscodedImageCache -ErrorAction Stop).TranscodedImageCache
[System.Text.Encoding]::Unicode.GetString($TIC) -replace '(.+)([A-Z]:[0-9a-zA-Z\\])+','$2'
1
  • It should be noted that this returns the last used image, even if none is currently used.
    – not2qubit
    Dec 24, 2022 at 20:48
1

I found the Windows 10 (theme) background folder here:

%USERPROFILE%\AppData\Local\Microsoft\Windows\Themes\RoamedThemeFiles\DesktopBackground

(I use the built-in themes of Windows 10 so maybe this doesn't work every time.)

1

To complete xypha's answer I have to note that:

Windows 10 Personalize Settings shows 5 wallpapers used recently, IF THE ORIGINAL FILES STILL EXIST but, if you set your wallpaper using the Windows 10's Photos app, a copy of the image will be kept in this location (only 1 photo will be kept):

%LOCALAPPDATA%\Packages\Microsoft.Windows.Photos_8wekyb3d8bbwe\LocalState\PhotosAppBackground\

Similarly, for the Lock Screen background:

%LOCALAPPDATA%\Packages\Microsoft.Windows.Photos_8wekyb3d8bbwe\LocalState\PhotosAppLockscreen\

If the directories do not exist, It's most likely that for each version of Windows, the Photos app version might be different so mind the trailing characters in this folder name: Microsoft.Windows.Photos_8wekyb3d8bbwe, look around and in the parent directory (%LOCALAPPDATA%\Packages\) and you will find the folder related to the Photos app Microsoft.Windows.Photos_RandomCharacters. My version of Windows 10 is 1803.

1

It hasn't been mentioned yet, but in the Registry Editor, you can navigate to:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers

To find a list of filenames and locations of your current as well as the past few background images that you have used.

0

You don't explain exactly what is the FINAL purpose of this, so I can give some tips here based on a guess: you want to change your wallpaper in certain conditions (for example, one wallpaper every time you restart your computer) or to use a custom file as wallpaper.

In Windows 7 the wallpaper was usually found in %AppData%\Microsoft\Windows\Themes\TranscodedWallpaper.
In Windows 10 you will find it in %AppData%\Microsoft\Windows\Themes\CachedFiles.

You can also interrogate the registry at

HKEY_CURRENT_USER\Control Panel\Desktop\TranscodedImageCache

but note the warnings below about programs that are NOT writing a file to disk!

If you want to build your own CMD script, this might be unreliable IF you set the wallpaper not from Windows but from an external program. For example, if I see a nice image in my browser, I set it as wallpaper directly from there. Same for IrfanView. I can easily name another 10 popular programs that could change the wallpaper to a custom path.

Note that some programs are changing the wallpaper without actually writing a file to disk. This can be done by hooking to the Microsoft Windows Desktop window and drawing directly on its canvas. This is how GIF/AVI animations are drawn on desktop.

There is another issue if you build your own script: How to you handle images that don't have same aspect ratio as your desktop, or when desktop resolution changes?

The solution (if I guessed your problem correctly) would be to use a program like John's Background Switcher or BioniX Desktop Background Changer. The latter is much more customizable and can be controlled via command line. It also has auto-detection to detect the best way to resize the image (fill/fit/tile). BioniX can also draw GIF without writing anything to disk (as explained above).

A even better way would be to use the "Lock on folder" option. Set BioniX to change your wallpaper every 60 seconds (don't worry, you won't see a new wallpaper every 60 seconds since you will use only one file). Set BioniX to lock on any folder (let's say C:\Wallpapers). Inside that folder you put a single file called something like My Wallpaper.jpg. BioniX will use that file as wallpaper every 60 seconds. Now, every time you want to change the wallpaper you replace the old My Wallpaper.jpg with your new file. BioniX will see the change you have done to the folder and apply the new file (within 60 seconds).


Let us know what you want to achieve with your script to get a better solution.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .