forked from jumpserver/Jmservisor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJmservisor.ahk
99 lines (91 loc) · 1.64 KB
/
Jmservisor.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
if(A_Args[1]="chrome"){
Run,%2% --app=%3% --start-maximized
WinActivate, ahk_exe chrome.exe
BlockInput,on
Sleep, 10000
SetKeyDelay, 30
Send, {Tab}
Sleep, 100
Send, %4% ;用户名
Send, {Tab}
sleep, 100
Send, %5% ;密码
Send, {Tab}
Send, {Enter}
BlockInput,off
return
}
if(A_Args[1]="mysql_workbench"){
Run, %2%
WinActivate, ahk_exe MySQLWorkbench.exe
BlockInput,on
Sleep, 10000
SetKeyDelay, 30
Send , ^u
Send, {Tab} ;跳过保存连接选项
Send, {Tab} ;跳过连接选型选项
Send, {Tab} ;跳过Tag选项
sleep, 100
Send, ^a ;输入IP
Send, %3%
sleep, 100
Send, {Tab}
Send, ^a ;输入端口
Send,%4%
sleep, 100
Send, {Tab}
Send, ^a ;输入用户名
Send, %5%
sleep, 100
Send, {Tab}
Send, {Enter} ;输入密码
Send, %6%
Send, {Enter}
sleep, 100
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Enter} ;确定
BlockInput,off
return
}
if(A_Args[1]="vmware_client"){
Run,%2%
WinActivate, ahk_exe VpxClient.exe
BlockInput,on
Sleep, 10000
SetKeyDelay, 30
; 第二次登录 有IP记录情况
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, {Tab}
Send, %3% ;IP
Send, {Tab}
Sleep, 100
Send, %4% ;用户名
Send, {Tab}
sleep, 100
Send, %5% ;密码
Send, {Enter}
BlockInput,off
return
}
if(A_Args[1]="custom"){
if(!FileExist(A_Args[2]) or InStr(FileExist(A_Args[2]),"D")){
return
}
params := ""
if(A_Args.length() > 2){
for index,param in A_Args{
if(index > 2){
params := params " " param
}
}
}
Run,%2% %params%
return
}
return