lee321987 Posted February 11, 2023 Share Posted February 11, 2023 I run Node-Red (it's a console app) with this command: Run(@ComSpec & " /k node-red") If I run node-red by typing "node-red" into a console I can exit/quit node-red by pressing CTRL+C, but when it's started by AutoIt, CTRL+C does nothing. Anyone know why or how to get CTRL+C working? Link to comment Share on other sites More sharing options...
ioa747 Posted February 11, 2023 Share Posted February 11, 2023 but win close is Alt + F4 CTRL+C is for copy ? I know that I know nothing Link to comment Share on other sites More sharing options...
lee321987 Posted February 11, 2023 Author Share Posted February 11, 2023 1 minute ago, ioa747 said: but win close is Alt + F4 CTRL+C is for copy ? It's a console app -- most console apps (including Node-Red) are quit using CTRL+C Link to comment Share on other sites More sharing options...
ioa747 Posted February 11, 2023 Share Posted February 11, 2023 (edited) Not to me with win10 An other explanation is which keyboard is active may bee the native keyboard? https://www.howtogeek.com/254401/34-useful-keyboard-shortcuts-for-the-windows-command-prompt/ Edited February 11, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
Solution mistersquirrle Posted February 11, 2023 Solution Share Posted February 11, 2023 I think that this is an issue with how running an uncompiled script works in AutoIt. You can test the issue with this: #include <AutoItConstants.au3> Local $iPid = Run(@ComSpec & ' /k ping 127.0.0.1 -t ', '', @SW_SHOW, $RUN_CREATE_NEW_CONSOLE) If you run that from SciTE and try to do Ctrl + c to cancel it, or Ctrl + BREAK, neither work and the ping continues. However, if you set the flag #AutoIt3Wrapper_Change2CUI=y And then compile the script and run it, you ARE able to cancel it with Ctrl + c. So I think that if you're looking for that Ctrl + c functionality, just keep in mind that you'll need to compile the script to get it. Here's my full test: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include-once #include <AutoItConstants.au3> Local $iPid = Run(@ComSpec & ' /k ping 127.0.0.1 -t ', '', @SW_SHOW, $RUN_CREATE_NEW_CONSOLE) lee321987 1 We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
lee321987 Posted February 11, 2023 Author Share Posted February 11, 2023 @mistersquirrle THANK YOU! Compiling worked. I didn't need: #AutoIt3Wrapper_Change2CUI=y 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