From dd09d341d4c094ba5f6001733074595fceb932d9 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Thu, 21 Sep 2023 18:12:11 +0200 Subject: [PATCH] Fix runas if bat not run as admin --- install.bat | 4 ++-- uninstall.bat | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install.bat b/install.bat index 611ed89..b82a95b 100644 --- a/install.bat +++ b/install.bat @@ -11,5 +11,5 @@ SET arguments=-UpdatesAtLogon -UpdatesInterval Weekly -InstallUserContext -Start :: Run Powershell Script :: :::::::::::::::::::::::::::: -SET PowershellCmd=Start-Process powershell.exe -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments% -powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}" -Verb RunAs +SET PowershellCmd=Start-Process powershell.exe -Verb RunAs -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments% +powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}" diff --git a/uninstall.bat b/uninstall.bat index 25a214a..9a33c87 100644 --- a/uninstall.bat +++ b/uninstall.bat @@ -11,5 +11,5 @@ SET arguments=-Uninstall :: Run Powershell Script :: :::::::::::::::::::::::::::: -SET PowershellCmd=Start-Process powershell.exe -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments% -powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}" -Verb RunAs +SET PowershellCmd=Start-Process powershell.exe -Verb RunAs -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments% +powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}"