Jump to content

Application restarts after script exits


Go to solution Solved by ptclarke,

Recommended Posts

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  
 

Link to post
Share on other sites

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
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.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...