Skip to content

Instantly share code, notes, and snippets.

@JBlond
Forked from eliashussary/change-wallpaper.bat
Created September 1, 2021 06:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JBlond/9b201a9436f97445fbc30ed9d88e9e1a to your computer and use it in GitHub Desktop.
Save JBlond/9b201a9436f97445fbc30ed9d88e9e1a to your computer and use it in GitHub Desktop.
A simple batch script to change your windows wallpaper. It takes a single argument, the path of your desired wallpaper.
echo off
:: Handle CLI Args
IF [%1]==[] (
echo No wallpaper path provided, please provide a full qualified path. Ex: C:\dir1\dir2\wallpaper.jpg
exit /b 1
)
:: Commands
echo Changing wallpaper to: %1
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d %1 /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment