批量去除Windows10系統中某個應用(以OneDrive爲例)的開機啓動項腳本以下:shell
reg query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run | findstr "OneDrive" if ($? -eq "True"){ reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v OneDrive /f }
注:安全
啓動項路徑還可能在註冊表的如下路徑中:ide
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run" "HKCU:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run"
Windows10默認安全設置是不能執行powershell腳本,須要經過組策略開啓執行powershell腳本執行或手動以管理員權限執行如下命令:rest
Set-ExecutionPolicy Unrestricted