i put an shortcut in shell:startup
if i deactivate "run as Administrator" the shortcut works fine
But with admin rights (i need them) it wont show up
Thats the shortcut-proberties:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command "C:\Users\admin\Downloads\Execute_Windows_Update.ps1"
Execute_Windows_Update.ps1:
Set-ExecutionPolicy RemoteSigned
Install-Module -Name PSWindowsUpdate
Import-Module PSWindowsUpdate
Install-WindowsUpdate -AcceptAll -AutoReboot
CodePudding user response:
Windows does not allow startup items to UAC elevate. This was strictly enforced in Vista
Error message when you start a Windows Vista-based computer: "Windows has blocked some startup programs"
This was relaxed a bit in 7 but some things are still probably blocked to prevent a flooding of UAC prompts at startup.
The task scheduler is a way around this.