PDA

View Full Version : system command in background



asdfwe
01-13-2008, 07:11 AM
i have a line in my code
system("dir") in a program in dev c++
it causes a seperate window command prompt to open and then it executes.

can we run it in background so that user does not even know of execution of the command

Zengar
01-13-2008, 07:14 AM
This doesn't have anything to do with OpenGL. I suggest you ask this question in a C++ forum...

asdfwe
01-13-2008, 11:33 AM
it is being used in part of my opengl project .

Bob
01-13-2008, 12:26 PM
It doesn't matter if your project uses OpenGL or not. Running a system command in the background is totally irrelevant to OpenGL.

HenriH
01-13-2008, 12:42 PM
I agree with Bob; this is unrelated to OpenGL. Try CodeProject.com for example.

But to answer to this question shortly: No, you can't. The system function always opens up a console window displaying the results of the command. You can try using popen, or even better, use the Windows API to get directory contents. Ask from C++ forum for details.

asdfwe
01-14-2008, 07:54 AM
thanks Henri H