How to execute dos commands in C++??

Newbie Member
23Feb2009,21:31   #1
officespace's Avatar
guys i love programming in C++...i am a b.tech student...while doin a project i came across an idea of implementing dos in C++..i did search the net for it but couldnt get any solution...any experts/programmers who hav the solution plzz help me!!...thanx in advance!!
Mentor
23Feb2009,22:36   #2
xpi0t0s's Avatar
I'm not clear what you mean - do you want to call DOS (by which I presume you mean MS-DOS) commands from a C++ program, or are you talking about reimplementing the Command Prompt in C++?
Newbie Member
24Feb2009,11:52   #3
officespace's Avatar
yeah exactly...call a dos command from C++ program(like "dir" to giv the directories)....use the dir command in C++ to obtain the directory as we get in cmd!!..its bit crazy....still any chance??...thanx for the response!
Mentor
24Feb2009,13:58   #4
xpi0t0s's Avatar
Try system()