-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainscript.ahk
More file actions
38 lines (31 loc) · 1.2 KB
/
mainscript.ahk
File metadata and controls
38 lines (31 loc) · 1.2 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
#SingleInstance Force
; this just runs all scripts now, check mainscript2.ahk for the actual main script.
; bad naming cuz im lazy
; if not admin, start as admin
; taken from https://www.autohotkey.com/boards/viewtopic.php?p=523250#p523250
if (!A_IsAdmin) {
try {
; MsgBox("Running as admin...")
Run("*RunAs `"" A_ScriptFullPath "`"")
; wait, so that the script doesnt continue running and instead restarts as admin (hopefully) before this runs out, otherwise it will just close.
Sleep(10000)
MsgBox("Couldn't run " A_ScriptName " as admin! Exiting..")
Sleep(5000)
ExitApp()
}
catch {
MsgBox("Couldn't run " A_ScriptName " as admin! Exiting..")
Sleep(5000)
ExitApp()
}
}
; run other scripts
kids := ["apploop.ahk", "text-shortcuts.ahk", "../ahk-win-switcher/alttab.ahk", "mainscript2.ahk"]
for s in kids {
Run("*RunAs .\" s "")
}
; run with an argument (1) to skip my "run as admin" warning in the bat script. (it is ran with admin if this script is.)
Run(A_ComSpec " /C " A_ScriptDir "\synctime.bat 1", A_ScriptDir, "Hide") ; run sync time script
Run("D:\tools\ThrottleStop\ThrottleStop.exe")
; now exit :)
ExitApp()