Hi, Wasn't sure if i would be wasting people time with this rather odd request but after a day of Googleing I've given up trying to find a simple solution, I'm looking for a way to open the currently displayed desktop wallpaper in something like paint.net for editing. The closest thing I've found is a reg file to add a context menu and a VBS script that is meant to open an explorer window and highlight the current image, the only problem is it opens an explorer window but doesn't highlight the image. I tried editing the VBS script to point to the paint.net exe but with no knowledge of VBS i didn't know if explorer.exe could be replaced with PaintDotNet.exe, or how it should be done if it is possible, it maybe a simple thing for someone with VBS knowledge but it's not for me. The salient part of the VBS script is as follows.. Code: Set WshShell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") strMsg = "Completed!" & Chr(10) & Chr(10) & "WPTargetDir.vbs - © 2010 Ramesh Srinivasan" & Chr(10) & Chr(10) & "Visit us at http://www.winhelponline.com/blog" strCurWP ="" On Error Resume Next strCurWP = WshShell.RegRead("HKCU\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource") On Error Goto 0 If Trim(strCurWP) = "" Then MsgBox "No Wallpaper selected for Desktop Slideshow" Else If fso.FileExists(strCurWP) Then WshShell.run "explorer.exe" & " /select," & strCurWP Else MsgBox "Cannot find target for " & strCurWP End If End If If anyone can point out why it's not highlighting the current image, or even better get paint.net to open the current image it would be much appreciated.
Just an update, I've gotten a little closer as now the script opens paint.net but i think it's not handling the output from WshShell.RegRead correctly as when paint.net open it says the image type is not recognised. I have a feeling either the output from reading the registry value or when that output is being passed onto the WshShell.run command for paint.net that it's not handling the fact that the images are on another drive, or that the file names contain spaces. Code: Set WshShell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") strCurWP ="" On Error Resume Next strCurWP = WshShell.RegRead("HKCU\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource") On Error Goto 0 If Trim(strCurWP) = "" Then MsgBox "No Wallpaper selected for Editing" Else If fso.FileExists(strCurWP) Then WshShell.run """C:\Program Files\paint.net\PaintDotNet.exe""" & strCurWP Else MsgBox "Cannot find target for " & strCurWP End If End If Anyone got some advise on how i should be using WshShell.RegRead or WshShell.run when dealing with files containing spaces that are located on another drive. EDIT: Sorted it. I had to add & chr(34) before & strCurWP Now i can edit the current background in paint.net
I done it so i didn't have to trawl through 3k images trying to find the one being used for the background if it had a border, wasn't in B&W, didn't like it, or anything else i wanted to do with it. TBH it seems odd that Windows doesn't have something like this built in as trying to find what desktop background you're using is a right PITA.
The original source file- no idea. But I'm pretty sure windows creates a copy of the file in a backgrounds file somewhere because I seem to remember coming across it and finding my five background in it that I had in rotation. Not sure if that'd help you or not.
current wallpaper image is copied to here Code: C:\Users\ [YOURUSERNAME] \AppData\Roaming\Microsoft\Windows\Themes
To everyone saying where the wallpaper image is stored you have my thanks, but i already knew where it was stored, what i wanted to do and have since done is to be able to right click on the desktop and have paint.net open with the currently displayed image ready for editing. Basically i modified the reg file and script from the link in my OP to add a context menu that when used runs a modified script, in turn that queries the registry key storing the path to the current wallpaper and then passes that into a command to start paint.net with said image. I've edited the title to save any confusion as the problem is now solved.