kevev Posted June 17, 2009 Share Posted June 17, 2009 Hello all! Been a while since I used autoit. I am trying to run openvpn when a button is clicked. Openvpn starts, but none of the buttons in my script work until I kill the openvpn service. I would like my stop button and exit button to work. Is there an easy way to do this? I was thinking of creating another autoit script to start openvpn and have my main script just call it. But I am afraid I will have the same issue. Thank You in advance. Here is my loop. While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton ExitLoop Case $msg = $exititem ExitLoop Case $msg = $Connect _RunDOS($openvpn) Case $msg = $aboutitem MsgBox(0, "About", "info") EndSelect WEnd Link to comment Share on other sites More sharing options...
Authenticity Posted June 17, 2009 Share Posted June 17, 2009 _RunDOS() calls internally RunWait() AutoIt function so you may want to use Run(@ComSpec & "\Something.exe") in hidden mode. Link to comment Share on other sites More sharing options...
kevev Posted June 18, 2009 Author Share Posted June 18, 2009 _RunDOS() calls internally RunWait() AutoIt function so you may want to use Run(@ComSpec & "\Something.exe") in hidden mode. Yeay! That got it. Took me a while to get the syntax right. Example code below. $openvpn = "openvpn --config " & $ProgramPath & "\settings.ovpn" Run($openvpn, "", @SW_HIDE) One more question. How do I track the openvpn pid and kill it with my disconnect button? Link to comment Share on other sites More sharing options...
kevev Posted June 18, 2009 Author Share Posted June 18, 2009 Yeay! That got it. Took me a while to get the syntax right. Example code below. $openvpn = "openvpn --config " & $ProgramPath & "\settings.ovpn" Run($openvpn, "", @SW_HIDE) One more question. How do I track the openvpn pid and kill it with my disconnect button? Nevermind. I got it. Now I need to make sure a command called by a button completes, then show a popup with the status. Anyone know how to do that cleanly? Link to comment Share on other sites More sharing options...
herewasplato Posted June 18, 2009 Share Posted June 18, 2009 You might want to look into StdoutRead http://www.autoitscript.com/forum/index.ph...st&p=696414 [size="1"][font="Arial"].[u].[/u][/font][/size] 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