简体   繁体   中英

Powershell - Run Shortcut as Admin doesn't work (Windows)

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM