How can I open a console window and run a command line?

A

Allen Maki

I would appreciate if someone helps me.



I am reading a book called MS visual c++ .net step by step. I am using
Visual C++ .net version 2003. I am trying to learn reading from file
using system::io. I have been asked to build the application, open a
console window, change to the project's Debug directory, and run the program
with a suitable command line, such as Cppfiles sa.



Can anybody tell me how can I open a console window and run the program with
a command line?
 
W

William DePalo [MVP VC++]

I have been asked to build the application, open a
console window,

Choose Run from the Start menu, type

cmd.exe and

click OK
change to the project's Debug directory,

Look at the "change directory" command

cd
and run the program with a suitable command line, such as Cppfiles sa.

Once you are in the directory where the file cppfiles.exe is you can just
type its name.
Can anybody tell me how can I open a console window and run the program
with a command line?

I did that above, on the assumption that the instructions were to do that
manually. My guess is that you think that the instructions are asking you to
do that programmatically. I don't think that that is case because for
virtually all applications with consoles, there is no "open the console"
step. Consoles are opened automatically by the runtime for applications
which were tagged as console applications at link time.

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top