-
Notifications
You must be signed in to change notification settings - Fork 0
/
GW2start.bat
20 lines (15 loc) · 951 Bytes
/
GW2start.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@echo off
cd /d "%~dp0"
for /F %%A in ('powershell.exe -Command "if ($(Get-ExecutionPolicy) -eq \"Restricted\") { echo 1 } else {echo 0}" ') do set policy=%%A
if %policy% EQU 1 (
echo "Your computer is set to NOT allow PowerShell scripts. Please press any key to continue, you will be asked to allow administrative rights once, than a window will open and close instantly, this will allow PowerShell to run GW2start for the future. If you don't want this: close this window and delete GW2start.bat - it will not work without this change."
pause
powershell.exe -Command "Start-Process powershell.exe -Verb runAs -ArgumentList \"-Command Set-ExecutionPolicy RemoteSigned -Force;\""
)
powershell.exe -Command "Invoke-WebRequest https://github.com/Tinsus/GW2-updater-script/raw/main/GW2start.ps1 -OutFile GW2start.ps1"
IF "%~1"=="" (
powershell.exe -file "GW2start.ps1"
) else (
powershell.exe -file "GW2start.ps1" "config"
)
del "GW2start.ps1"