Espawn Tool

by Alexander Kogtenkov (modified: 2016 Apr 26)

Description

Espawn is a tool used to launch one or more applications or processes in the same environment as configured by finish_freezing and like tools. The applications/processes can be launched either synchronously or asynchronously and options are provided to continue or halt on a process' erroneous exit code.

espawn does launch applications and processes asynchronously but is not asynchronous itself. espawn exits when all processes have completed and not before. Users with a one single-core processor will not gain from the asynchronous behavior as they espawn caps the the number of asynchronous processes to the number of resident system processors/cores

Usage Tips

Asynchronous Execution

Asynchronous commands can be processed by passing multiple commands with the -async switch:

espawn --async command_1 command_2 command_nth

Switching to x86 Environments (x64 only)

For x64 users there is an option to launch an x86 environment for working with a 32bit environment instead of the default 64bit. This is under the condition that you have the tools installed for both x64 and x86.

To force the use of an installed 32bit environment use the --x86 switch. To use a manually configured environment, suppressing the auto-config use the --manual switch. Note that -manual overrides --x86.

If you also happen to be inside an x86 environment (using the Visual Studio .NET Cross Tools Command Prompt or a self configured command prompt) you may switch to using the x64 by not specifying the --x86 switch.

Manual Usage of an Environment

If you do not want espawn to automatically select the most recent C/C++ compiler environment available on your system, you can specify which environment to take. You may only use the environments located on your system.

To list the available environments that can be use use

espawn -l

If you are running the x64 version of espawn you can specify the --x86 switch also to list the x86 applicable environments discoverable on your system. The list is formatted using

CODE: Environment Name

To select an environment when executing command with espawn, specify the --use switch. Here is an example of using Visual Studio .NET 2003, using the x64 version of espawn:

espawn "link @app.lnk" --x86 --use:VS71

Note: For x64 users: Some environments are only available using the --x86 because they only provide x86 compiler tools. All versions of the Visual Studio Visual C/C++ compilers prior to Visual Studio 2005 are x86 compatible only. Failure to specify the --x86 switch will present a warning indicating the environment was not set up correct.

Continuous Environment

If you want to continue using an automatically configured environment, as setup by espawn, there is a neat trick. Just type the following in cmd.exe:

espawn cmd

This will enter a new cmd session with the environment established as dictated by espawn. Typing exit will return you to the previous cmd shell.

You can of course use all of the other options if you so wish.

More Info

There are more options so please use the following for more information:

espawn /?

Links