Set a certain image to windows desktop wallpaper on system startup.
Create set-wallpaper.bat
:
@echo off
Powershell.exe -executionpolicy remotesigned -File set-wallpaper.ps1
Create in same directory set-wallpaper.ps1
:
Function Set-WallPaper($imagePath)
{
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Params
{
[DllImport("User32.dll",CharSet=CharSet.Unicode)]
public static extern int SystemParametersInfo (Int32 uAction,
Int32 uParam,
String lpvParam,
Int32 fuWinIni);
}
"@
$SPI_SETDESKWALLPAPER = 0x0014
$UpdateIniFile = 0x01
$SendChangeEvent = 0x02
$fWinIni = $UpdateIniFile -bor $SendChangeEvent
$ret = [Params]::SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, $imagePath, $fWinIni)
}
Set-WallPaper -imagePath "C:\Files\Images\3840x1600\Pluto.jpg"
Set set-wallpaper.bat
to run on startup:
Task Manager -> Start-up
Or: Run (WINDOWS + R) and type shell:startup, paste .bat/shortcut file