Join Stack Overflow to learn, share knowledge, and build your career. I'm writing an application where there are two calls to external programs, RichCopy and 7zip. The idea is to use RichCopy to move files and 7zip to archive and encrypt the files once RichCopy finishes. The problem I'm having is that the application isn't waiting for RichCopy to finish moving files before 7zip tries to archive them despite the fact that I'm using WaitForExit. So RichCopy kicks off, but immediately after I see the splash screen for RichCopy 7zip starts archiving and encrypting an empty folder.
Is there something I'm missing or is the WaitForExit method supposed to wait until the process finishes before moving on to the next line of code? My guess is that the first richcopy executable you started probably starts another process which then does the real copying work.
A working example of Wait for exit: Ric Tokyo 5, 2 23 Thanks for the response. I'll do some digging into RichCopy to see what's going on there. I debated using a Wait command, but because the directories to be copied are variable in size I don't think I can safely choose a time for the program to wait. The process you return is f1. Nzall 2, 3 11 Thanks Nate - I'll give these suggestions a try. I did try to isolate the file copy part of the program and that is working as expected.