Skip to content

Instantly share code, notes, and snippets.

@raveren
Last active January 17, 2024 18:27
Show Gist options
  • 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
@MoneyAllDay
Copy link

Please feel free to use my slightly different wallpaper script. This one opens the folder and highlights the image.

What are the odds this was exactly what i was looking for and you just posted it 19 days ago?

Thank you!

@crius-al
Copy link

Please feel free to use my slightly different wallpaper script. This one opens the folder and highlights the image.

What are the odds this was exactly what i was looking for and you just posted it 19 days ago?

Thank you!

The odds are 100%. :)

@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