Having recently upgraded to Windows 8, my script to retrieve the current desktop wallpaper image has broken.

For Windows 7, How could I find out the path to the current desktop image?, this works great. However, that registry key now always contains


What is the new registry key used for Windows 8?

I've found two possible solutions.

Firstly, this key contains what looks like a Base64 encoded path:


And then there is the "custom theme properties file" which also contains a "[SlideShow]" section which looks like Base64:

  • I’m interested in the seemingly (but apparently not) base64-encoded registry entries. Why would Microsoft encode them like that? What’s to gain from hiding that basic information? – Synetech Jan 11 '17 at 2:00

The two registry keys below both store the original path of the current wallpaper image:

HKEY_CURRENT_USER\Control Panel\Desktop\TranscodedImageCache
HKEY_CURRENT_USER\Control Panel\Desktop\TranscodedImageCache_000

They're in Unicode format, upon decoding that, one will have the full path to the current wallpaper image.

| improve this answer | |
  • 3
    Just a clarification for anyone messing around with this: the value contains non-string data in first 24 bytes, and the remaining data is a Unicode encoded, null-terminated (\0) string. Happy parsing. – Nathan Taylor Jan 20 '14 at 20:31
  • In powershell, it's [System.Text.Encoding]::Unicode.GetString($bytes[24..($bytes.length-1)]), assuming $bytes contains the value of the key – NextInLine Feb 10 '15 at 21:39
  • 2
    full twoliner powershell: $bytes=(New-Object -ComObject WScript.Shell).RegRead("HKEY_CURRENT_USER\Control Panel\Desktop\TranscodedImageCache_000"); $path=([System.Text.Encoding]::Unicode.GetString($bytes[24..($bytes.length-1)]) -split "\0")[0] – Mark Harviston Sep 10 '16 at 21:54
  1. Go to Windows Run Command (WinLogo+R)
  2. Type in: %AppData%
  3. In the 'Roaming' folder, go to 'Microsoft', then 'Windwows', then 'Themes', and lastly 'CachedFiles'
  4. Copy the wallpaper file.
| improve this answer | |
  • This is so straightforward and quick. I grabbed the file, changed the extension to .jpg and there it was. – valsidalv Nov 6 '15 at 18:42

Check the HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper REG_SZ (string) value. This will show you the path to the TranscodedWallpaper.jpg currently in use.

| improve this answer | |
  • Thank you! That pointed me to the correct registry location at least. I not only wanted the current wallpaper but the path to the original file (like Window 7 did), which is in the TranscodedImageCache entry. – Scott Bennett-McLeish Nov 20 '12 at 22:56

For windows 8 or later you can launch this vbs file:


Or use this autohotkey script:


Both created by me.

| improve this answer | |

In Windows 8 and 8.1 (and, reportedly, 10), if you have set your wallpaper from Windows Picture Viewer (by opening a picture in Viewer and clicking "Set as desktop wallpaper" in the context menu), its location will be

%AppData%\Roaming\Microsoft\Windows Photo Viewer\Windows Photo Viewer Wallpaper.jpg
| improve this answer | |

In my situation I have a huge folder of images that my wallpaper cycles thru. I get bored of some after awhile and want to delete them or sometimes I just wonder what the image name is because it can have the description of the image.

I built 2 scripts based on the feedback above - one to get the current image path and one to delete it. Only tested this on Windows 10.

Get the image path (getwallpaper.ps1)

$bytes=(New-Object -ComObject WScript.Shell).RegRead("HKEY_CURRENT_USER\Control Panel\Desktop\TranscodedImageCache")
$wallpaperpath=$wallpaperpath.substring(0, $wallpaperpath.IndexOf("jpg", 0, $wallpaperpath.Length)+3)
write-output $wallpaperpath
Write-Host -NoNewLine 'Press any key to continue...';
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');

Delete the image (deletewallpaper.ps1)

$bytes=(New-Object -ComObject WScript.Shell).RegRead("HKEY_CURRENT_USER\Control Panel\Desktop\TranscodedImageCache")
$wallpaperpath=$wallpaperpath.substring(0, $wallpaperpath.IndexOf("jpg", 0, $wallpaperpath.Length)+3)
write-output $wallpaperpath
Write-Host -NoNewLine 'Delete the file (y=yes)?'
$KeyOption = 'Y','N'
while ($KeyOption -notcontains $KeyPress.Character) {
 $KeyPress = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
 if($KeyPress.Character -eq 'y') { Remove-Item $wallpaperpath }
| improve this answer | |
  1. Go to C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Themes.
  2. Create a copy of TranscodedWallpaper
  3. Rename the copy to <NAME>.JPG

Tested on Windows 10

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.