Skip to content

Instantly share code, notes, and snippets.

@raveren
Last active January 17, 2024 18:27
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save raveren/ab475336cc69879a378b to your computer and use it in GitHub Desktop.
Save raveren/ab475336cc69879a378b to your computer and use it in GitHub Desktop.
Open current wallpaper in windows8
Set Shell = CreateObject("WScript.Shell")
' change to TranscodedImageCache_001 for second monitor and so on
openWallpaper("HKCU\Control Panel\Desktop\TranscodedImageCache_000")
function openWallpaper(regKey)
arr = Shell.RegRead(regKey)
a=arr
fullPath = ""
consequtiveZeroes = 0
For I = 24 To Ubound(arr)
if consequtiveZeroes > 1 then
exit for
end if
a(I) = Cint(arr(I))
if a(I) > 1 then
fullPath = fullPath & Chr(a(I))
consequtiveZeroes = 0
else
consequtiveZeroes = consequtiveZeroes + 1
end if
Next
Shell.run Chr(34) & fullPath & Chr(34)
end function
Wscript.Quit
@raveren
Copy link
Author

raveren commented Jan 17, 2024

Same line of thought reused in this Autohotkey script:

https://gist.github.com/raveren/bac5196d2063665d2154

look for WIN+W

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment