-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautostart.ahk
37 lines (35 loc) · 956 Bytes
/
autostart.ahk
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
;SetKeyDelay, 150, 150
SetTitleMatchMode, 2
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
b = C:\Users\%A_Username%\Google Drive\file share
if !FileExist(b)
b = C:\Users\%A_Username%\Documents\share\file share
if !FileExist(b)
b = C:\Users\Administrator\Google Drive\file share
if !FileExist(b)
b = C:\Users\Admin\Google Drive\file share
OutputDebug %b%
global b
IfInString,A_UserName,Admin
{
;sleep 20000
FileCopy, %b%\host.ahk , %A_ScriptDir% , 1
FileCopy, %b%\start.ahk , %A_ScriptDir% , 1
asd = "%b%\host.ahk"
OutputDebug %asd%
RunWait Ahk2Exe.exe /in host.ahk /out host.exe
RunWait Ahk2Exe.exe /in "start.ahk" /out start.exe
sleep 500
Run *RunAs start.exe
}
else
{
sleep 15000
FileCopy, %b%\host.ahk , %A_ScriptDir% , 1
FileCopy, %b%\start.ahk , %A_ScriptDir% , 1
RunWait Ahk2Exe.exe /in host.ahk /out host.exe
RunWait Ahk2Exe.exe /in "start.ahk" /out start.exe
sleep 500
Run *RunAs start.exe
}
ExitApp