Click here to Skip to main content
15,895,973 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Increase mainframe window if right side of inserted view is out of MainFrames client area Pin
Fusshoeller10-Nov-09 22:20
Fusshoeller10-Nov-09 22:20 
Questionhow to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo9-Nov-09 7:03
devgo9-Nov-09 7:03 
AnswerRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
Randor 9-Nov-09 7:17
professional Randor 9-Nov-09 7:17 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo9-Nov-09 7:28
devgo9-Nov-09 7:28 
QuestionRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
David Crow9-Nov-09 7:52
David Crow9-Nov-09 7:52 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
Randor 9-Nov-09 7:54
professional Randor 9-Nov-09 7:54 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo9-Nov-09 9:18
devgo9-Nov-09 9:18 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
Randor 9-Nov-09 10:19
professional Randor 9-Nov-09 10:19 
Hi Dev.

I suggest that you research and seek to understand STDIN STDOUT STDERR[^] because when you open a command prompt and you type DIR you are actually writing to the STDIN stream. After you research these streams you will have a better understanding of my answer.

devgo wrote:
i am looking to execute a command once the cmd.exe process has started. how can i do this?


You have been given several options.

Option 1.) Pass a command on the CreateProcess command line.

>cmd /?
/C      Carries out the command specified by string and then terminates
/K      Carries out the command specified by string but remains


Option 2.) Interact with the standard input handle and pass commands.

How to spawn console processes with redirected standard handles[^]

These are your best options if you are using CreateProcess to open the command prompt as you described in your original post.

Here is another Microsoft sample of redirecting the input/output handles.
Creating a Child Process with Redirected Input and Output[^]

Best Wishes,
-David Delaune
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo9-Nov-09 10:56
devgo9-Nov-09 10:56 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo11-Nov-09 9:15
devgo11-Nov-09 9:15 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
Randor 11-Nov-09 16:34
professional Randor 11-Nov-09 16:34 
QuestionIs there a way to register an activeX ocx file with relative path and not full path? Pin
eyal_balla9-Nov-09 4:31
eyal_balla9-Nov-09 4:31 
AnswerRe: Is there a way to register an activeX ocx file with relative path and not full path? Pin
Chris Losinger9-Nov-09 5:34
professionalChris Losinger9-Nov-09 5:34 
QuestionHow do I get contents of long strings in VS 2008 debugger? Pin
Interrobang9-Nov-09 4:28
Interrobang9-Nov-09 4:28 
AnswerRe: How do I get contents of long strings in VS 2008 debugger? Pin
loyal ginger9-Nov-09 4:48
loyal ginger9-Nov-09 4:48 
AnswerRe: How do I get contents of long strings in VS 2008 debugger? Pin
Chris Losinger9-Nov-09 4:50
professionalChris Losinger9-Nov-09 4:50 
QuestionSimple CToolTipCtrl trouble. Pin
Nikz29-Nov-09 4:20
Nikz29-Nov-09 4:20 
AnswerRe: Simple CToolTipCtrl trouble. Pin
Code-o-mat9-Nov-09 5:24
Code-o-mat9-Nov-09 5:24 
GeneralRe: Simple CToolTipCtrl trouble. Pin
Nikz29-Nov-09 5:52
Nikz29-Nov-09 5:52 
GeneralRe: Simple CToolTipCtrl trouble. Pin
Code-o-mat9-Nov-09 5:59
Code-o-mat9-Nov-09 5:59 
GeneralRe: Simple CToolTipCtrl trouble. Pin
Nikz29-Nov-09 6:13
Nikz29-Nov-09 6:13 
GeneralRe: Simple CToolTipCtrl trouble. Pin
Code-o-mat9-Nov-09 7:30
Code-o-mat9-Nov-09 7:30 
GeneralRe: Simple CToolTipCtrl trouble. Pin
Nikz29-Nov-09 10:48
Nikz29-Nov-09 10:48 
Question'c' Program [modified] Pin
singh.niraj40@yahoo.com9-Nov-09 4:01
singh.niraj40@yahoo.com9-Nov-09 4:01 
AnswerRe: 'c' Program Pin
Chris Losinger9-Nov-09 4:03
professionalChris Losinger9-Nov-09 4:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.