Command Line Program To End Before Moving Onto The Next Command In Loop?Feb 4, 2011
I am using a CheckedListBox that is populated with Filenames (full path, i.e. C:TestTest.jpg)When I have the files that I want in the CheckedListBox I wish to click a Start Button which will process the list one at a time using an exe program that runs on the Command Line. There are arguments that need to pass to the command line as well as the file location in order for the program to process.I currently have it working but the issue is the loop finishes quickly and it is left up to the CMD.exe to finish the process. What I would like is for the LOOP to wait until each file completes processing before passing the command for the next file in the CheckedListBox.There some reasons I wish for it to work this way.
1) I would like to have a button that can Pause/Restart the Loop.
2) I would like to have a button that can Stop the Loop so the whole process can end.
3) I would like to have the Loop remove each file one by one from the CheckedListBox after it has been processed.
4) I would like to display a Message once all the files have been processed.
5) And if it were possible I would like to report the status either by text or a progress bar showing where it is at in the process.
6) And the ability to add some error handling if possible.
Since the Loop finishes so quickly as it just passes the command to the command line using the & as a seperator it is the command line that is handling the rest of the process. Because of this there is not control over it in the GUI.The code I am using allows the Command Line text to display in the Form so it won't open up a seperate window to run CMD.exe. This is the desired affect as I would like everything to appear to run from within the Form itself.