-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopyAddVPNCommand.ahk
More file actions
51 lines (29 loc) · 1.65 KB
/
CopyAddVPNCommand.ahk
File metadata and controls
51 lines (29 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
#SingleInstance, Force
; ########################### Copy Commands Button Variables #################################
;
; ######### Networking Tab #######
Network_Button_1 = ipconfig /all
; ##################################### GUI Design ####################################
Gui, Add, Text,, Enter VPN Name
Gui, Add, Edit, W180 vVPNNAME, VPN
Gui, Add, Text,, Enter Server Address
Gui, Add, Edit, W180 vVPNADDRESS
Gui, Add, Text,, Enter Pre-Shared Key
Gui, Add, Edit, W180 vSECRETKEY
Gui, Add, Button, gCopy, COPY
Gui, Show, W200 H210, Copy Add VPN Command ; Display GUI
return ; End of auto-execute section. The script is idle until the user does something.
; ################ Copy Button Output ##################
Copy: ; Enter what the button will do below
GuiControlGet, VPNNAME,, %VPNNAME% ; Get the data from the button that was presses
GuiControlGet, VPNADDRESS,, %VPNADDRESS% ; Get the data from the button that was presses
GuiControlGet, SECRETKEY,, %SECRETKEY% ; Get the data from the button that was presses
Clipboard = Add-VpnConnection -AllUserConnection -Name `"%VPNNAME%`" -ServerAddress %VPNADDRESS% -TunnelType L2tp -EncryptionLevel Optional -AuthenticationMethod PAP -L2tpPsk `"%SECRETKEY%`" -Force -PassThru
MsgBox, 32, Copied Command to Clipboard, Add-VpnConnection -AllUserConnection -Name `"%VPNNAME%`" -ServerAddress %VPNADDRESS% -TunnelType L2tp -EncryptionLevel Optional -AuthenticationMethod PAP -L2tpPsk `"%SECRETKEY%`" -Force -PassThru, 2
ExitApp
; Reload the GUI
return
; Close Button, Exit Script
GuiClose:
GuiEscape:
ExitApp