المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : "Virtual" Command Prompt



C++ Programming
03-14-2010, 04:12 AM
Hi All,

I am trying to add a cmd functionality into my app, however it's not working very well and I am looking for alternate methods. What I'm going right now is taking an input command and using CreateProcess with cmd /C *command* > outputFile, then reading the file and displaying the output. However, the problem with this approach is that if I want to start an app, lets say Notepad, I would not be able to do anything else until Notepad closes. As well, the cd command is rendered useless, as when cmd exits and I call another command, the new cmd created by CreateProcess is still at the same directory.

Does anyone have any suggestions for a different approach - perhaps somehow piping the input/output from the cmd window directly to my app?

Thanks very much. http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif