Not quite sure if I should be posting this in the Windows Programming area or this one but I'll try here.

I have 2 projects going, both executables. Project 1 uses project 2 in it's loop to get file information from specified directories. When I use it in a loop it can open hundreds of times (obviously 1 for every file is found). They all terminate after they've completed their tasks but it's absolutely horrible for the resources.
Is there a quick code to add into my loops that will wait for that process to finish before opening a new one?

I was thinking about using another function which verifies the file information was successfully read then runs it again but that creates the problem of errors popping up all over the place (only because that's how I have set my catches).

For example:

Code:
//up here is where I get all files in folder
//then for each file found that is in my string project2.exe is run
foreach(string file in getfInfo)
{
Process.Start("project2.exe", filename)
}
I should almost send a screenshot of all the windows popping up and closing! It's like a little circus on my desktop!

Thanks,

If you need the real code I'll post it but I think it's probably not necessary.

---Rob Sitter
[Professional At Novice]