system command in background

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

This doesn’t have anything to do with OpenGL. I suggest you ask this question in a C++ forum…

it is being used in part of my opengl project .

It doesn’t matter if your project uses OpenGL or not. Running a system command in the background is totally irrelevant to OpenGL.

I agree with Bob; this is unrelated to OpenGL. Try 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.

thanks Henri H