forked from bakaxbaka/CryptoAutoPilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_admin.bat
More file actions
61 lines (50 loc) · 1.65 KB
/
Copy pathstart_admin.bat
File metadata and controls
61 lines (50 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@echo off
setlocal enabledelayedexpansion
title CryptoAutoPilot - Admin Launcher
color 0A
:: Get the directory where this batch file is located
set SCRIPT_DIR=%~dp0
set PS_SCRIPT="%SCRIPT_DIR%start.ps1"
echo.
echo ==============================================================
echo CryptoAutoPilot - Admin Launcher
echo ==============================================================
echo.
echo [INFO] Script directory: %SCRIPT_DIR%
echo [INFO] PowerShell script: %PS_SCRIPT%
echo.
:: Check if the PowerShell script exists
if not exist %PS_SCRIPT% (
echo [ERROR] PowerShell script not found: %PS_SCRIPT%
echo [INFO] Please ensure start.ps1 is in the same directory as this batch file.
goto :error
)
echo [INFO] Checking for administrator privileges...
net session >nul 2>&1
if %errorlevel% neq 0 (
echo [INFO] Requesting administrator privileges...
echo [INFO] This will open a new administrator window.
echo.
:: Try to run PowerShell with admin rights
powershell -Command "Start-Process powershell -ArgumentList '-ExecutionPolicy Bypass -File %PS_SCRIPT% -Force' -Verb RunAs"
echo [INFO] Admin request sent. Please approve the UAC prompt if it appears.
) else (
echo [INFO] Administrator privileges detected.
echo [INFO] Launching CryptoAutoPilot...
echo.
:: Run PowerShell script directly since we already have admin rights
powershell -ExecutionPolicy Bypass -File %PS_SCRIPT% -Force
)
goto :end
:error
echo [ERROR] Launcher failed.
pause
exit /b 1
:end
echo.
echo [INFO] Launcher process completed.
if %errorlevel% neq 0 (
echo [WARNING] Process exited with code: %errorlevel%
)
pause
exit /b 0