1

Is there a windows registry entry for the original background location? At "HKEY_CURRENT_USER\Control Panel\Desktop", the value "Wallpaper" is "C:\Users\CURRENTUSER\AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper.jpg".

Bob
  • 217
  • 1
  • 4
  • 11
  • 1
    What do you mean by "original background location"? And why do you need this information? – In silico Dec 01 '10 at 07:00
  • Yes, that's the path to the current wallpaper displayed on your desktop (the CURRENT_USER). What are you searching for instead? – Cody Gray - on strike Dec 01 '10 at 07:04
  • I know its the current wallpaper being displayed, however when windows changes the background it creates a copy of the file from another location. That's what TranscodedWallpaper.jpg is: a copied file. This allows you to make any image your desktop image, and windows does not have to worry about anything happening to the image later. – Bob Dec 01 '10 at 16:45

3 Answers3

4

It actually depends how the wallpaper got there.

This works on Windows 7, when the wallpaper is set via the control panel and wallpaper slideshows are enabled:

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

In other situations, however, that key may not exist or may be stale.

(Ignore the fact it has "Internet Explorer" in the path. Who knows why that is, but IE isn't involved!)

(FWIW, I found/used this when making a desktop context menu (via VBScript) to delete the current wallpaper. Here it is if it's useful.)

Leo Davidson
  • 6,093
  • 1
  • 27
  • 29
  • That is exactly what I was looking for. I'm surprised it is hiding in Internet Explorer entries. Thank you very much. – Bob Dec 01 '10 at 16:40
0

In gpedit, the "Active Desktop Wallpaper" setting in User Configuration|Administrative Templates|Desktop|Active Desktop does set the background. Ignore the fact that it's in the Active Desktop section, as it still works with Active Desktop disabled. Active Desktop only needs to be enabled if using JPG or HTML for the background.

Deepu
  • 1
0

You can write custom vb script and right click menu.

--- Create reg file and double click.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\DesktopWallpaperLocation]
"icon"="imageres.dll,-5346"
@="Desktop Wallpaper Location"

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\DesktopWallpaperLocation\command]
@=hex(2):77,00,73,00,63,00,72,00,69,00,70,00,74,00,20,00,22,00,25,00,77,00,69,\
  00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,\
  33,00,32,00,5c,00,57,00,61,00,6c,00,6c,00,70,00,61,00,70,00,65,00,72,00,50,\
  00,61,00,74,00,68,00,2e,00,76,00,62,00,73,00,22,00,00,00

This will create a link to right menu like "Desktop Wallpaper Location" and it will open as selected in explorer.

--- Vb script file (edited for multiple monitors).

Const HKCU = &H80000001 'HKEY_CURRENT_USER

sComputer = "."

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

sKeyPath = "Control Panel\Desktop\"
sValueName = "TranscodedImageCache_001"
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

arrValues = Split(sContents, "\\")
b = ubound(arrValues)
result = arrValues(0)

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

sValueName = "TranscodedImageCache_000"
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

arrValues = Split(sContents, "\\")
b = ubound(arrValues)
result = arrValues(0)

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

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

arrValues = Split(sContents, "\\")
b = ubound(arrValues)
result = arrValues(0)

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

Save as *.vbs file and copy to c:\windows\system32 folder. (c:\windows\system32\WallpaperPath.vbs)

besimler
  • 13
  • 6