This powershell script was made as a workaround to OS policies that will try to set a default wallpaper on startup. This script will set the wallpaper to the image of your choice on startup.
-
Clone this repository to your local machine or just download the
.ps1
and.cmd
file.The
.ps1
file is the powershell script that will set the wallpaper. The.cmd
temporarily sets the powershell execution policy to unrestricted to allow the script to run. This is necessary because the default execution policy is restricted, which will not allow the script to run.Make sure that the
.ps1
and.cmd
files are in the same directory. -
Open the
.ps1
file in any text editor. -
On the first line of the
.ps1
file, there is a$wallpaperPath
variable:$wallpaperPath = ""
Fill the string variable with the full path to the image you want to use.
-
Save the now-modified
.ps1
file. -
Copy the
.cmd
file. -
Open the run dialogue box by pressing
Win + R
and typeshell:startup
and press enter. -
Paste the modified
.cmd
file into the startup folder as a shortcut ("paste as shortcut" in your right-click context menu). -
Restart your computer and enjoy your new wallpaper!