use c++ to drive cmd window and get responses
-
Windows 7, Visual Studio 2008, C++ Question: Is there a way to use C++ with a dialog or other GUI to open a DOS CMD window, feed it commands, let it run, and capture the output from those commands? Parts of the output will be used for follow up commands. We may need to change directory more than once so consistency between commands will be rather helpful. Motivation: A very extensive and heavily used application is all command line. We want to create a GUI to drive it.
Thanks for your time If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig\_106/
-
Windows 7, Visual Studio 2008, C++ Question: Is there a way to use C++ with a dialog or other GUI to open a DOS CMD window, feed it commands, let it run, and capture the output from those commands? Parts of the output will be used for follow up commands. We may need to change directory more than once so consistency between commands will be rather helpful. Motivation: A very extensive and heavily used application is all command line. We want to create a GUI to drive it.
Thanks for your time If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig\_106/
-
Windows 7, Visual Studio 2008, C++ Question: Is there a way to use C++ with a dialog or other GUI to open a DOS CMD window, feed it commands, let it run, and capture the output from those commands? Parts of the output will be used for follow up commands. We may need to change directory more than once so consistency between commands will be rather helpful. Motivation: A very extensive and heavily used application is all command line. We want to create a GUI to drive it.
Thanks for your time If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig\_106/
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
thanks for the links. No, DOS is not dead. There are still some things to do with command line. Power Shell is a supercharged DOS. It can do much that the various Unix/Linux scripts do. I did some more searching and remembering. Now I have concluded that using Expect to drive this command line application is probably the text way. ExpectTk is probably even better. It will be better and easier to develop than a C++ solution. Thanks for taking the time to read and respond.
Thanks for your time If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig\_106/
-
thanks for the links. No, DOS is not dead. There are still some things to do with command line. Power Shell is a supercharged DOS. It can do much that the various Unix/Linux scripts do. I did some more searching and remembering. Now I have concluded that using Expect to drive this command line application is probably the text way. ExpectTk is probably even better. It will be better and easier to develop than a C++ solution. Thanks for taking the time to read and respond.
Thanks for your time If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig\_106/
To be exact, DOS is a operation system, and command line in windows is just a application, we call it console. You can use GetStdHandle to get the standard output in a running GUI application, or use CreateProcess to spawn a process and redirect it's output to do the same thing.