jamaz Posted November 2, 2009 Share Posted November 2, 2009 (edited) 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 November 2, 2009 by jamaz Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 2, 2009 Moderators Share Posted November 2, 2009 (edited) 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 November 2, 2009 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. Link to comment Share on other sites More sharing options...
jamaz Posted November 2, 2009 Author Share Posted November 2, 2009 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 2, 2009 Moderators Share Posted November 2, 2009 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now