Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

OpenVPN Autologin script


  • Please log in to reply
2 replies to this topic
mightymike
  • Members
  • 5 posts
  • Last active: Apr 02 2006 02:48 PM
  • Joined: 19 Mar 2006
heres my autologin script for the OpenVPN Gui version.


#NoTrayIcon
#SingleInstance force
; Example: Simple input-box:

IfExist, login.txt
{

FileReadLine, name, login.txt, 1
FileReadLine, pass, login.txt, 2


}
else
{

Gui, Add, Text,, Username:
Gui, Add, Text,, Passwort:
Gui, Add, Edit, vFirstName ym  ; The ym option starts a new column of controls.
Gui, Add, Edit, vLastName
Gui, Add, Button, default, OK  ; The label ButtonOK (if it exists) will be run when the button is pressed.
Gui, Show, Login Daten eingeben
return  ; End of auto-execute section. The script is idle until the user does something.

ButtonOK:
GuiClose:
GuiEscape:
Gui, Submit  ; Save the input from the user to each control's associated variable.
FileAppend, %FirstName%`n, login.txt
FileAppend, %LastName%`n, login.txt
Process, Close, autovpnrun.exe
MsgBox, 0, , Deine Daten wurden eigentragen,bitte starte autovpn neu. 


}




Process, Exist, openvpn-gui.exe
NewPid=%ErrorLevel%
if NewPID = 0 
{
run C:\Programme\OpenVPN\bin\openvpn-gui.exe --connect fhte.ovpn
}




WinWait, OpenVPN - User Authentication, Username:
IfWinNotActive, OpenVPN - User Authentication, Username:, WinActivate, OpenVPN - User Authentication, Username:
WinWaitActive, OpenVPN - User Authentication, Username:
Send, %name%{tab}%pass%{ENTER}
IfWinExist, OpenVPN Connection (fhte)
{
WinClose, OpenVPN Connection (fhte)
}
ExitApp









Lambert
  • Guests
  • Last active:
  • Joined: --
Hi,

I just used this script to create the auto login. But now I'm faced with the problem how to clear the username/password from my system. Each time I start the openvpn, the programs uses this saved login. Please how do I clear the login or reset it?

Boontjie
  • Members
  • 9 posts
  • Last active: Jun 30 2011 02:13 PM
  • Joined: 23 Jun 2011
Delete the login.txt file