floof Posted October 9, 2012 Share Posted October 9, 2012 So to keep it simple, I'm basically integrating a Compiler into a GUI with a button to send Text commands to CMD Code: Private Sub btnCPL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCPL.Click Shell("CMD.exe") SendKeys.Send(txtSCOCL.Text) SendKeys.Send(" 0x7DD1E61C ") SendKeys.Send(txtC.Text) SendKeys.Send(" ") SendKeys.Send(txtOUT.Text) SendKeys.Send("{ENTER}") End Sub Problem: When I run the first compile, it's flawless. But upon clicking again, it appears the SendKeys.Send("{ENTER}") line gets stuck on my Compile button and constantly opens Command Promt (CMD.exe) over and over (non-stop) So the question is, would there be a line to add after the {ENTER} to stop/rest the script? Link to comment Share on other sites More sharing options...
nightwalker83 Posted October 10, 2012 Share Posted October 10, 2012 You could probably use a Boolean and after you press the button the first time set it to true after initializing it as false then surround you code with conditional statement that checks whether the operation has been carried out. If the Boolean is true then it has. 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