Problem: My code create too much process.
Question: How to limit the quantity on process created in parallel.
Background: for backup zip7 and the Task Scheduler of window 2008 is used. A task performs (Action) zip of all the files in a directory. The result is 1 zip for each file (I don't want 1 zip with all the files).
the action (in the Task Scheduler) is: cmd
the arguments are:
/C FOR %i IN (*.nsf) DO "C:\Program Files\7-Zip\7z.exe" -bd u "\\Server_name\Backup\%~ni.zip" "%~fi">>c:\resuZip.log
Don't care too much if you're not familiar with the syntax, it works, this is not the problem.
The problem is that FOR creates for *each* file a process (like a fork in C) and the server nearly collapses.
How could I limit the creation of parallel tasks ?
Thanks in advance.