SPAWN is a small command line tool for Windows to execute a number of tasks in parallel.
You want to process a number of files with a command line tool of your choice, but you don't have the time to process each file after another and you don't want to spin up more processes then, lets say, the number of your CPU cores.
- Copy
spawn.exein the folder of your command line tool. E.g. a Windows batch file. - Run
spawn.exewithout any command line arguments and answer the following questions (entering nothing takes the default value):- Application: The path to your tool.
- Argument Format: The command line arguments you want to pass to
your tool, where
{0}stands for the file to process. - Max Concurrency: The maximum number of parallel working tasks, 0 for all tasks in parallel.
- Pass all files you want to process as command line arguments to
spawn.exe, e.g. by Drag&Drop the files from the Windows Explorer onspawn.exe.
> spawn.exe
Max Concurrency [4]: 3
Application: mytool.bat
Argument Format ["{0}"]:
Tasks from STDIN [false]:
> spawn.exe file1 file2 file3 file4 file5 file6
Requires file files.txt with one path per line.
> spawn.exe
Max Concurrency [4]:
Application: mytool.bat
Argument Format ["{0}"]:
Tasks from STDIN [false]: true
> spawn.exe < files.txt
The result is SPAWN running mytool.bat "file1", mytool.bat "file2", until
file4 in parallel, waits for one of the mytool.bat instances to finish
and immediately starts mytool.bat with the next waiting file until all
given files are processed.
- Microsoft Windows
- Microsoft .NET 4.0 or higher
- Use Microsoft Visual Studio 2012 to build the
Spawn.slnsolution. - Or open a console in the projects root folder and run
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /p:Configuration=Release Spawn.sln