0

Please tell me how to open two files simultaneouly using system();

I want to open two file and I am doing it like

system("C:\temp\file1.doc");
system("C:\temp\file2.doc");

But here till the file 1 is open file 2 is not opening as the control is not able to reach the second system call , Is there a way to do open them simultaneously.

Thanks Shashank

lurker
  • 56,987
  • 9
  • 69
  • 103
  • 2
    If you know you want to use, say, MS Word, then you could do it with one command: `system("C:\Program Files\ C:\temp\file1.doc C:\temp\file2.doc");` – lurker Mar 29 '14 at 14:25

1 Answers1

0

I would suggest two ways.

  1. Run two threads. Call system() from each thread.

  2. Create a child process using fork() and run system() from both parent and child processes.

HelloWorld123456789
  • 5,299
  • 3
  • 23
  • 33