Sign in to follow this  
Followers 0
ptclarke

Application restarts after script exits

8 posts in this topic

I am new to autoit and trying to figure things out.

My first script is pretty basic and is designed automate the steps to get connected to my employer's VPN.

 

Rough description:

Start the RSA SecureID application

Paste my PIN

Copy the token to the clipboard

Close the RSA app.

Run the Nortel VPN Client

Paste the token in there

"Hit" Enter

Everything works great.  However somewhere around 3 to 5 minutes later the RSA app pops up again on the desktop.

Any clues as to what might be happening?

Here is the the script:

 #include <Clipboard.au3>
 #include <GuiEdit.au3>
$yesno = MsgBox( 36, "VPN Apps", "Connect to VPN?" )
If $yesno = "6" Then
; Yes button was clicked  
   Run("C:Program FilesRSA SecurID Software TokenSecurID.exe")
   WinWaitActive("000127560000 - RSA SecurID Token")
   Send("1234")
   Sleep( 100 )
   Send("{ENTER}")
   Sleep( 100 )
   Send("{CTRLDOWN}c{CTRLUP}")
   WinClose("000127560000 - RSA SecurID Token")
 
   Run("C:Program FilesNortelNortel VPN ClientNvc.exe")
; wait 10 seconds for the NVC GUI to appear.  If it doesn't, it probably means you are already connected and the Status GUI has popped up 

   $retcode1 = WinWaitActive("Nortel VPN Client", "" , 10 )
   If $retcode1 <> 0 Then
      Send("{CTRLDOWN}v{CTRLUP}")
      Sleep( 100 )
      Send("{ENTER}")
   _ClipBoard_Open(0)
   _ClipBoard_Empty()
   _ClipBoard_Close()
   Else
      Exit  
   EndIf
  
   $retcode2 = WinWaitActive("Security Banner", "" , 60 )
   If $retcode2 <> 0 Then
      Send("{ENTER}")
   Else
      Exit  
   EndIf  
EndIf
Exit  
 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

For one, you can use ClipPut and ClipGet for the clipboard stuff. (instead of sending Ctrl + C)

Like you said, the script only starts the program for you, if everything works as far as getting you connected initially to the VPN, then the glitch is on the Nortel software side I would imagine. I did a quick Google but didn't come up with anything specific about issues with Nortel. That is where I would be looking. Your script exits once the application is run so it is not possible that the script is the issue.

Edited by 0xdefea7

Share this post


Link to post
Share on other sites

Thanks for the ClipPut and ClipGet tip, 0xdefea7

I get what you are saying about this issue not being with the script, but this doesn't happen when I run the two apps manually.

Curious.

Cheers

Share this post


Link to post
Share on other sites

Thanks again, but that has nothing to do with my issue.

Perhaps you misunderstood my problem.  It is the RSA token app that pops up again, not the Nortel VPN client. 

Anyway no big deal.  I was just using this script as an AutoIt intro for myself.  I am not under any pressure to produce a working tool for others to use.

Share this post


Link to post
Share on other sites

Mystery solved.

Although I was doing a WinClose for the RSA token, the process was staying active.

I added ProcessClose ( "SecurID.exe" ) after the WinClose line and everything is fine now.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks for sharing that answer :)

Glad that you got it solved.

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  
Followers 0