How to execute dos commands in C++??

officespace's Avatar, Join Date: Feb 2009
Newbie Member
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!!
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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++?
0
officespace's Avatar, Join Date: Feb 2009
Newbie Member
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!
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
Try system()