-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstall_Startup_Task.bat
More file actions
26 lines (22 loc) · 993 Bytes
/
Copy pathInstall_Startup_Task.bat
File metadata and controls
26 lines (22 loc) · 993 Bytes
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
@echo off
:: =============================================================================
:: Install_Startup_Task.bat - Self-Elevating Installer for AutoHotkey Startup Task
:: =============================================================================
:: Check for Administrator privileges
net session >nul 2>&1
if %errorLevel% neq 0 (
echo Requesting Administrator privileges...
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
cd /d "%~dp0"
echo ========================================================
echo Registering AutoHotkey Startup Script in Task Scheduler...
echo ========================================================
echo.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0setup_startup_task.ps1"
echo.
echo ========================================================
echo Setup complete! Press any key to close this window.
echo ========================================================
pause >nul