How to Find Current Wallpaper (Desktop Background) File Location in Windows 7

Desktop Background Slideshow is a neat little feature in Windows 7 which helps you shuffle your desktop background from a image file store folder, at predefined intervals. But, as Windows doesn’t show the file name of the currently displayed wallpaper, it becomes a problem if you have thousands of images in a store folder and you need to find the file name and the directory location of the currently displayed wallpaper.

Here is a small script which adds the Desktop Background File Location option in the Desktop context menu, which opens the current wallpaper file’s target folder and selects the file.

Note: This script doesn’t work in Windows 8 or 10. If you’re using Windows 8/8.1 or Windows 10, see article How to Determine the Current Wallpaper File Name and Path in Windows 8 and 10.

1. Download WPTargetDir.zip, unzip and extract the contents to a folder.

2. Move the file WPTargetDir.vbs to the Windows directory.





3. Double-click Add.reg to add the context menu option.

4. Hold the SHIFT key down and right-click on an empty area in the Desktop. You’ll see the Desktop Background File Location option.

Selecting this option gets the current wallpaper file name from the registry, opens the target folder and selects the image file.

To remove/uninstall this option, run the file undo.reg, and then manually delete WPTargetDir.vbs manually from the Windows folder.

More Information

The script queries the wallpaper source file name from the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General

The information is stored in a string value named WallpaperSource

35 thoughts on “How to Find Current Wallpaper (Desktop Background) File Location in Windows 7

  1. The script works whimsically. It either shows correst file in the wallpaper Folder (L:\My Pictures\Twitter Pictures) or opens my User Folder (C:\Users\Amarnath Wanchoo) depending on its mood.

    I have not been able to efit the script to always work properly. can you please help

    Amarnath Wanchoo

  2. Is there a way to have the file name appear on the desktop picture instead of having to right-click and find it?

  3. Hi. I had to tweak your script a little to work on my computer. You see I have set a path in which there are several space characters. So, line 22 has become:

    WshShell.run “explorer.exe” & ” /select,” & Chr(34) & Trim(strCurWP) & Chr(34)

  4. Windows 8.1 (Pro) still contains the key:
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General

    However, it shows the source as
    C:\Windows\web\wallpaper\Windows\img0.jpg

    when in fact the source is one of several files contained in a self-added directory under C:\Windows\Web which is were you add your own personal wallpaper collections. The wallpaper works perfectly with any pictures you wish to add, but the location problem still exists.

    The actual wallpaper in use is shown at key
    HKEY_CURRENT_USER\Control Panel\Desktop

    with a value of
    C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper

    Unless someone can decode and interpret how Windows is choosing and then transcoding – copying – the image from one location to the next, we appear to be out of luck with this tweak.

  5. This used to work great. It was one of the first 5-10 things I added to a computer upon build.

    Now, however, it doesn’t drill down to the exact wallpaper, it simply opens the wallpaper directory.

    I keep my wallpapers on an external drive, do you think that could be the problem?

  6. Hi, Great work. But as others said, the key is pointing to wrong directory. Got a similar discussion at : http://stackoverflow.com/questions/11278707/wheres-the-wallpaper-registry-key-in-windows-8

    There was a registry key mentioned there –
    KEY: HKEY_CURRENT_USER\Control Panel\Desktop
    VALUE: C:\Users\Thomas\AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper

    But this is not the original wallpaper but the transcoded one. Can something be done ?

    -Thanks in Advance

  7. I moved the WPTargetDir.vbs to the desktop so I now have a working shortcut there. Far easier to get the info especially if it’s on a slideshow

  8. Windows 8 is great but sadly missing this ability to show the name of the wallpaper file. I have two monitors and it used to work OK on Windows 7.

    Please, please can we have a version that will work on Windows 8?

  9. This script also doesn’t work if there are commas in the path (filename). See the comment by Chris D above for the fix. That is meant for spaces, but it handles commas as well since all it does is put the path string in quotes.

  10. I have enjoyed using this on Windows 7 on two monitors which both showed the same picture.

    Now on Windows 8 it doesn’t work at all; it seems that the registry entry to locate the wallpaper file name is now different and Windows 8 shows a different picture on each monitor when using the Slideshow.

    Can I edit anything to make it work or, even better, will there be a Windows 8 usable version?

  11. I know this is an older post ; but it would also be awesome if you could also write something to delete / recycle the current desktop picture as well. I have a massive collection of desktop backgrounds and there isn’t any easy way to prune 9k+ images.

  12. FYI – if copying and pasting the code above, be careful because the blog’s comment system converts quotation marks into “smart quotes”. After pasting the code into a text editor, delete any quotation marks and manually retype them to make sure they are not smart quotes.

  13. Thanks to the author, this is very helpful.

    To make it work with file paths containing spaces, change the following line in WPTargetDir.vbs. Original version:

    WshShell.run “explorer.exe” & ” /select,” & strCurWP

    Fixed to support spaces:

    WshShell.run “explorer.exe” & ” /select,” & chr(34) & strCurWP & chr(34)

    Also, if you don’t want to have to hold Shift in order to see the item in the right-click menu, delete this line from add.reg before you import it into your registry:

    “Extended”=””

  14. This is exactly what I was looking for! Thanks so much. I used Autohotkey to assign a hotkey and now I just push a button to open the current desktop wallpaper. Perfect.

  15. As it’s been pointed out, if there are any spaces in the file name or path to the file, this script will bring up the My Documents folder.

    And I second the request for displaying the file name. If the folder it’s in has a lot of files, its hard to locate the file.

  16. I’m with Seth – please see if you can have the name of the file displayed in a corner.

    This can be done with my screensaver – ssmypics.scr – and it would be a great improvement to the slide show if the name of the file was displayed in that too.

  17. I frackin love this script. It is exactly what I have been wanting for ages.
    It worked for me once, but since then it opens my user folder with My Documents highlighted, instead of going to ‘…/my pictures/art’ like it did before I deleted the folder (see below)….. anyone have any ideas for a fix?

    (I extracted to a folder in downloads, moved the .vbs to WINDOWS.
    and added the add.reg. Then when I deleted the folder from downloads it stopped working …. so i ran the undo.reg, and tried to start again but looks like i borked it. :( )

  18. Thanks – this is great. I have 11 years of digital photos set as a slide show so now I can delete the rubbish shots!

  19. Wow, this is great. I have huge collections of pictures that I like to use for backgrounds and as I add more I realize that some of the older pictures are no longer up to the same standards, but with a thousand pictures per directory finding and deleting them has always been a hassle. This not only tells me the file name, but brings me straight to the file’s location. I hope Microsoft throws you some money and adds this as a new feature in a future update. Thanks!!

  20. Scratch that guys. I got it working :)

    I had to reload\change picture lcoation then goback to desktop pics. and it worked.. YOU ROCK!

    Thanks So Much!

  21. Thanks Was hoping to display name in corner… Thanks for the code. I think I can get it working with samurize, I’ve been looking off and on for this for years.

  22. Great script – just what I was looking for!

    There was a problem with the folder “天使的眼淚 – 嘉” from W7 personalization gallery though. Guess it’s the foreign characters.

Comments are closed.