Indeed I found two methods. One using CMD-R to run some windows magic, and another by setting the PATH value to null with ('').
However, apparently there is another registry item containing the path in hex encoded form, in HKCU:\Control Panel\Desktop\TranscodedImageCache, that you can see by the rudimentary hex conversion.
# Set the wallpaper PATH to ''
$key = 'HKCU:\Control Panel\Desktop'
Set-ItemProperty -Path $key -Name 'WallPaper' -Value ''
# Re-start windows Explorer:
Stop-Process -ProcessName explorer
# Using `CMD+R` and run :
shell:::{ED834ED6-4B5A-4bfe-8F11-A626DCB6A921} -Microsoft.Personalization\pageWallpaper
# Getting the "Transcoded" PATH:
$TIC=(Get-ItemProperty 'HKCU:\Control Panel\Desktop' TranscodedImageCache -ErrorAction Stop).TranscodedImageCache
[System.Text.Encoding]::Unicode.GetString($TIC) -replace '(.+)([A-Z]:[0-9a-zA-Z\\])+','$2'
#C:\Windows\Web\Wallpaper\Windows\_img0.jpg
Also related to this answer.
- You need to restart windows
explorer.exe (use Sysinternal's Process Explorer or PS with: Stop-Process -ProcessName explorer) in order for registry changes to take effect.
UPDATE: 2020-01-09
- You don't need to re-start explorer, nor compile anything via PoweShell, ... almost. From THIS blog and this SESU answer, I found a fantastic one-liner:
add-type -typedefinition "using System;`n using System.Runtime.InteropServices;`n public class PInvoke { [DllImport(`"user32.dll`")] public static extern bool SetSysColors(int cElements, int[] lpaElements, int[] lpaRgbValues); }"
Now to get your desktop to instantly turn purple, run it with:
[PInvoke]::SetSysColors(1, @(1), @(0xAA40C0))
Or tack it on the end of above for a true one-line experience.
Notes from author: "This doesn't affect the Registry, so if you want the change to stick, you need to also write the new data to Registry yourself."
UPDATE: 2024-12-20
Latest Windows update just replaced everyone's desktop image with some MS rubbish. Thanks to comment by john-v-kumpf, you can apparently replace it with some registry love, like this:
sp 'HKCU:\Control Panel\Desktop' wallpaper "C:\Windows\Web\Wallpaper\Windows\img0.jpg"
Then you also need to run:
rundll32.exe user32.dll, UpdatePerUserSystemParameters
PS. I haven't updated yet, so I haven't tried this yet.