Jump to content
Sign in to follow this  
jamaz

Connect VPN through AUTOIT

Recommended Posts

jamaz

Hello everyone on the forum,

I've been searching the web for an answer, but could not find it. Perhaps you guys can help me with a small $var question.

I made a script for connecting to vpn on my work. The $user and $pass is not added to the RUN command. What do i do wrong.

thanks,

Jamaz

$user = InputBox("Loginname","Enter Loginname")

$pass = InputBox("Password","Enter Password","","*")

Run('"C:\Program Files\Cisco Systems\VPN Client\vpnclient.exe" connect "default profile" user $user pwd $pass"')

Edited by jamaz

Share this post


Link to post
Share on other sites
SmOke_N

Something like this maybe?

Global $s_user = "Put User Name Here"
Global $s_pass = "Put Password Here"
Global $s_vpnclient = @ProgramFilesDir & "\Cisco Systems\VPN Client\vpnclient.exe"
Global $i_vpn_pid = Run('"' & $s_vpnclient & '" connect user "' & $s_user & '" pwd "' & $s_pass)

Edit:

Although, it looks like to me here:

http://www.cisco.com/en/US/docs/security/vpn_client/cisco_vpn_client/vpn_client46/administration/guide/vcAch5.html

That "connect" needs a profile ( whatever that is ).

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
jamaz

Something like this maybe?

Global $s_user = "Put User Name Here"
Global $s_pass = "Put Password Here"
Global $s_vpnclient = @ProgramFilesDir & "\Cisco Systems\VPN Client\vpnclient.exe"
Global $i_vpn_pid = Run('"' & $s_vpnclient & '" connect user "' & $s_user & '" pwd "' & $s_pass)

Edit:

Although, it looks like to me here:

http://www.cisco.com/en/US/docs/security/vpn_client/cisco_vpn_client/vpn_client46/administration/guide/vcAch5.html

That "connect" needs a profile ( whatever that is ).

Hello,

Great thanks. I edited the code, here is my script sofar.

$user = InputBox("PRS Inlogcode","Voer uw PRS-4 lettercode in")

$pass = InputBox("Wachtwoord","Voer uw PRS wachtwoord in","","*")

Global $s_user = $user

Global $s_pass = $pass

Global $s_prof = "default profile"

Global $s_vpnclient = @ProgramFilesDir & "\Cisco Systems\VPN Client\vpnclient.exe"

Global $i_vpn_pid = Run('"' & $s_vpnclient & '" connect "' & $s_prof & '" user "' & $s_user & '" pwd "' & $s_pass)

DriveMapAdd( "h:", "\\10.16.40.10\$user" ,0, "domain\" & $user , $pass )

DriveMapAdd( "o:", "\\10.16.40.10\pool" ,0, "domain\" & $user , $pass )

I am dutch, so some text is in dutch. Can i change the run for shellexecute so the dos box wil not open?

Jamaz

Share this post


Link to post
Share on other sites
SmOke_N

Run('"' & $s_vpnclient & '" connect "' & $s_prof & '" user "' & $s_user & '" pwd "' & $s_pass, $s_vpnclient, @SW_HIDE)

To hide the cmd box


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.