Skip to content

Instantly share code, notes, and snippets.

@winhelponline
Created November 4, 2020 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save winhelponline/c669fe6b9b2ba13a980888e22fb0e398 to your computer and use it in GitHub Desktop.
Save winhelponline/c669fe6b9b2ba13a980888e22fb0e398 to your computer and use it in GitHub Desktop.
Find the current lock screen (Windows Spotlight) wallpaper file name (for v1709 & earlier)
'Finds current lock screen wallpaper file, copies it to Pictures folder and previews it.
'Ramesh Srinivasan, Winhelponline.com
'Created on 1 Sep, '16
'For Windows 10 v1709 and earlier
Dim WshShell: Set WshShell = Createobject("Wscript.Shell")
Dim objFSO: Set objFSO = Createobject("Scripting.Filesystemobject")
On error resume next
sCurrLSI = WshShell.RegRead ("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative\LandscapeAssetPath")
On error goto 0
sDstFL = WshShell.ExpandEnvironmentStrings( "%USERPROFILE%" )
sDstFL = sDstFl & "\Pictures\" & objFSO.GetFileName(sCurrLSI) & ".jpg"
if objFSO.FileExists(sCurrLSI) then
objFSO.copyfile sCurrLSI, sDstFL
WshShell.Run sDstFL
else
Msgbox "Lock Screen image file doesn't exist in the specified location."
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment