This will add a sheduled task to run the powershell script on login/workstation unlock without displaying a window.
Note: you can also try importing the XML file below for the task π€
- Open Task Scheduler
- Create Task under Task Scheduler Library
- Under Security Options:
- Run whether user is logged on or not
- This allows the window to be hidden
- Do not store password.
- Run with highest privileges
- Run whether user is logged on or not
- I had Configure for:
Windows 10
although I'm not sure if it matters
- Add a New... trigger
- Begin the task:
On workstation unlock
- You can likely add more but I did not test them
- Specific user: Change User...; select your user if you just want it for your account
- Add a New... action
- Action: Start a program
- Program/script:
powershell
- Add arguments:
-ExecutionPolicy Bypass -File "C:\Users\coder\Pictures\windows login backgrounds\_pull.ps1"
- Change out the path to match wherever you saved the
_pull.ps1
script
- Change out the path to match wherever you saved the
Profit! Now every time you log in the background will be saved in a backgrounds
directory next to the script.