~nickwinston123/armagetronad/arma_chatbot_config

« back to all changes in this revision

Viewing changes to manage_chatbot.bat

  • Committer: hackermans
  • Date: 2023-10-15 02:11:17 UTC
  • Revision ID: hackermans-20231015021117-76j6ash9s4sh2pc9
Ensure running as admin

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
@echo off
2
2
setlocal EnableDelayedExpansion
 
3
@echo off
 
4
:: Check for admin privileges
 
5
net session >nul 2>&1
 
6
if %errorLevel% == 0 (
 
7
    echo Running as administrator.
 
8
) else (
 
9
    echo Not running as administrator. Trying to elevate...
 
10
    goto UACPrompt
 
11
)
 
12
 
 
13
:: If the script has admin rights, continue with the rest of the script
 
14
goto startScript
 
15
 
 
16
:UACPrompt
 
17
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
 
18
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
 
19
 
 
20
    "%temp%\getadmin.vbs"
 
21
    exit /B
 
22
 
 
23
:startScript
3
24
 
4
25
set OPENVPN_PATH="C:\Program Files\OpenVPN\bin\openvpn.exe"
5
26
set REAL_IP=""