Jump to content

Run cmd using $STDIN_CHILD but not permanently.


Recommended Posts

I need to run some programs in a DOS shell. I can do it using Activate("cmd.exe") if I set the wintitlematchmode correctly, and then use Send to send the instructions.

After a few instructions a program starts up and the user needs to be able to use the program as normal using a keyboard.

It is difficult to ensure that the window stays active while the initial commands are sent.

I could overcome that by using StdInWrite, but then how do I switch the input back to the keyboard?

I don't think ControlSend can be used.

I can't change the programs.

Any ideas?

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hi martin!

This one was really ingenious but I have an idea.

I found this sourceforge project and as far I can see this console uses cmd.exe so you will not miss any functionality.

The point is that it's really easy to automate, ControlSend() worked like a charm muttley

Good luck! :)

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Hi martin!

This one was really ingenious but I have an idea.

I found this sourceforge project and as far I can see this console uses cmd.exe so you will not miss any functionality.

The point is that it's really easy to automate, ControlSend() worked like a charm muttley

Good luck! :)

Thanks for finding that monoceres. It does look like it's just what I need. Unfortunately it doesn't behave the same as the command prompt. I need to run 2 tsr's then a third program which has a graphical interface. All these must be run in the same DOS shell. The 2 tsr's start up fine but the main program causes horrible crashes, sometimes with endless error messages such as memory access violation, most of which are from explorer.

If I put the startup sequence in a batch file it seems that Windows does not run the tsr's and the main program in the same DOS shell so the main program can't function.

However, it could be useful. It is interesting to have found a way to use ControlSend with a Command prompt.

I've tried DosBox but it slows the program down too much no matter how fast I set it to run.

Maybe the best I can do is use BlockInput so that at least I can stop the user doing something which interferes with the startup of the application.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hi,

Have you tried SendKeepActive()?

No, I had never noticed that function, (and I see it's in the help for Send) so I'll try it. . It won't stop someone typing at the same time as the Send is operating so the blockinpout should sort that.

Seems to work fine for me! Thanks Skruge, really simple.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...