1
Script / Re: [SCRIPT] Set As Background Wallpaper (Stretched etc.)
« on: February 14, 2026, 20:04:50 »
Found a better & more improved (& much faster) version of this script thanks to an updated Generative AI ! Use this instead (as old one is kept for pure posterity)…
claude-opus-4-6-thinking AI Generated:::
PowerShell Script (SetWallpaperMCStretch.ps1)
MultiScript (Custom Command)
Notes (if you want other styles later)
These registry values are the ones Windows uses:
These are just quality-of-life tweaks. The core SystemParametersInfo approach remains the right one.
claude-opus-4-6-thinking AI Generated:::
PowerShell Script (SetWallpaperMCStretch.ps1)
Code: [Select]
param([string]$ImagePath)
# Validate file exists
if (-not (Test-Path $ImagePath)) {
Write-Error "File not found: $ImagePath"
exit 1
}
# Set style: Stretch
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name WallpaperStyle -Value '2'
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name TileWallpaper -Value '0'
# Apply wallpaper via Win32 API
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Wallpaper {
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
}
"@ -ErrorAction SilentlyContinue
# SPI_SETDESKWALLPAPER = 0x0014 (20)
# SPIF_UPDATEINIFILE | SPIF_SENDCHANGE = 3
[Wallpaper]::SystemParametersInfo(20, 0, $ImagePath, 3)
<#
Style Reference:
Stretch : WallpaperStyle=2, TileWallpaper=0
Fill : WallpaperStyle=10, TileWallpaper=0
Fit : WallpaperStyle=6, TileWallpaper=0
Center : WallpaperStyle=0, TileWallpaper=0
Tile : WallpaperStyle=0, TileWallpaper=1
Span : WallpaperStyle=22, TileWallpaper=0
#>
MultiScript (Custom Command)
Code: [Select]
@var $imgPath = GetSourceFocusPath();
@var $scriptPath = "C:\\Path\\To\\SetWallpaperMCStretch.ps1";
@var $arguments = "-ExecutionPolicy Bypass -WindowStyle Hidden -File \"" + $scriptPath + "\" -ImagePath \"" + $imgPath + "\"";
MC.Run CMD="powershell.exe" ARG="{$arguments}" FLAGS="NOWAIT|NOCONSOLE";
Notes (if you want other styles later)
These registry values are the ones Windows uses:
- Stretch: WallpaperStyle=2, TileWallpaper=0 (used above)
- Fill: WallpaperStyle=10, TileWallpaper=0
- Fit: WallpaperStyle=6, TileWallpaper=0
- Center: WallpaperStyle=0, TileWallpaper=0
- Tile: WallpaperStyle=0, TileWallpaper=1
These are just quality-of-life tweaks. The core SystemParametersInfo approach remains the right one.
Please consider it, because that is how I intended it to function —that's why I said "make it a Checkbox option in Core Settings or Explorer Panel" —I'am fine /w it as it is (in Popup Menu), but I'd just like it to remember the setting (should stick for the next launch automatically) ! Thank you ! 
I like how it plays the audio from video files as well (MP4's), I'am currently using this feature extensively !! 🙏 Happy holidays to everyone & God bless ! 🎄🎅
I could still loop my MP3 songs…
