簡體   English   中英

原始背景位置是否有 Windows 注冊表項?

[英]Is there a windows registry entry for the original background location?

原始背景位置是否有 Windows 注冊表項? 在“HKEY_CURRENT_USER\\Control Panel\\Desktop”,值“Wallpaper”是“C:\\Users\\CURRENTUSER\\AppData\\Roaming\\Microsoft\\Windows\\Themes\\TranscodedWallpaper.jpg”。

這實際上取決於壁紙是如何到達那里的。

這適用於 Windows 7,當通過控制面板設置牆紙並啟用牆紙幻燈片時:

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

但是,在其他情況下,該密鑰可能不存在或可能已過時。

(忽略路徑中有“Internet Explorer”這一事實。誰知道為什么會這樣,但不涉及 IE!)

(FWIW,我在制作桌面上下文菜單(通過 VBScript)以刪除當前壁紙時發現/使用了。如果它有用的話,這里是。)

在 gpedit 中,用戶配置|管理模板|桌面|活動桌面中的“活動桌面壁紙”設置確實設置了背景。 忽略它位於 Active Desktop 部分的事實,因為它在禁用 Active Desktop 的情況下仍然有效。 如果使用 JPG 或 HTML 作為背景,則僅需要啟用 Active Desktop。

您可以編寫自定義 vb 腳本和右鍵單擊菜單。

--- 創建 reg 文件並雙擊。

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

這將創建一個指向右側菜單的鏈接,例如“桌面壁紙位置”,它將在資源管理器中選擇打開。

--- Vb 腳本文件(為多顯示器編輯)。

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 & """"

另存為 *.vbs 文件並復制到 c:\\windows\\system32 文件夾。 (c:\\windows\\system32\\WallpaperPath.vbs)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM