macOS
#!/bin/bash
#/Users/mlamp/Pictures/20211020.png代表图片路径
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Users/mlamp/Pictures/20211020.png"'
windows
VBS:
----------
set ws=createobject("wscript.shell")
ws.regwrite "HKCU\Control Panel\Desktop\wallpaper","图片路径","REG_SZ"
ws.run "RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters"
----------
BAT:
----------
@echo off
reg add "hkcu\control panel\desktop" /v "wallpaper" /d "图片路径" /f
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters