StartProcess
✖
StartProcess
executes an external program, yielding a ProcessObject to represent the resulting subprocess.
executes an external program, passing it the specified arguments argi.
Details

- StartProcess returns a ProcessObject if the process it specifies can be started; otherwise, it returns $Failed.
- StartProcess can be used to interact with processes while they are running or to run "background tasks" without blocking the Wolfram Engine.
- StartProcess returns immediately and does not wait for the started process to complete. Use RunProcess to wait for a process to complete.
- In StartProcess[{"executable",arg1,arg2,…}], the argi are converted to strings using ToString.
- The Wolfram Engine can communicate with a subprocess represented by a ProcessObject with functions like WriteLine, WriteString, BinaryWrite, ReadLine, ReadString, and BinaryRead.
- The standard input, output, and error streams can be represented using ProcessConnection.
- Information about the subprocess can be queried using ProcessStatus and ProcessInformation.
- The following options can be given:
-
ProcessDirectory Inherited initial working directory ProcessEnvironment Inherited environment variables to give the subprocess - By default, the subprocess will inherit its process directory and environment variables from the Wolfram Engine.
- If the Wolfram Engine is terminated, the subprocess will be forced to close.
- If any of the arguments argi are of the form "name"->value, they will be converted into the form "--name=value". If name is a single character, only one dash will be used.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Start the system shell process:

https://wolfram.com/xid/09a7mpj8i-hp8oi3

Write a command into the system shell process:

https://wolfram.com/xid/09a7mpj8i-6j3c93

https://wolfram.com/xid/09a7mpj8i-32mxq4

Check whether the process is running or not:

https://wolfram.com/xid/09a7mpj8i-wfb484

Write an exit command into the shell process:

https://wolfram.com/xid/09a7mpj8i-ovl1yg
Verify the program has actually finished:

https://wolfram.com/xid/09a7mpj8i-g3788s

Possible Issues (4)Common pitfalls and unexpected behavior
The right way to call StartProcess for a program plus its arguments is using a list:

https://wolfram.com/xid/09a7mpj8i-c62gbc

Calling StartProcess with the command and arguments in a single string is not allowed:

https://wolfram.com/xid/09a7mpj8i-ey721d


Also, calling StartProcess with the program arguments as arguments for StartProcess is not allowed:

https://wolfram.com/xid/09a7mpj8i-5wu2d3


Special symbols like ~ and * are not converted using shell expansion, because StartProcess skips the shell:

https://wolfram.com/xid/09a7mpj8i-tud8bc

Shell commands like dir, echo cannot be called directly on Windows because they are not binaries (however, they work on Unix systems because they are Unix binaries):

https://wolfram.com/xid/09a7mpj8i-j9q8wd

Some commands might need to be called using absolute paths:

https://wolfram.com/xid/09a7mpj8i-2a8cjg

Interactive Examples (1)Examples with interactive outputs
Neat Examples (1)Surprising or curious use cases
Start a new WolframKernel process for parallel computation:

https://wolfram.com/xid/09a7mpj8i-eo3a0c


https://wolfram.com/xid/09a7mpj8i-4u43op

Make the kernel process do a long computation and quit:

https://wolfram.com/xid/09a7mpj8i-weany3

https://wolfram.com/xid/09a7mpj8i-xc6bk6
Read the process output whenever it finishes:

https://wolfram.com/xid/09a7mpj8i-862li0

Read any messages sent to the error stream:

https://wolfram.com/xid/09a7mpj8i-lz0mbk

Wolfram Research (2014), StartProcess, Wolfram Language function, https://reference.wolfram.com/language/ref/StartProcess.html.
Text
Wolfram Research (2014), StartProcess, Wolfram Language function, https://reference.wolfram.com/language/ref/StartProcess.html.
Wolfram Research (2014), StartProcess, Wolfram Language function, https://reference.wolfram.com/language/ref/StartProcess.html.
CMS
Wolfram Language. 2014. "StartProcess." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StartProcess.html.
Wolfram Language. 2014. "StartProcess." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StartProcess.html.
APA
Wolfram Language. (2014). StartProcess. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StartProcess.html
Wolfram Language. (2014). StartProcess. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StartProcess.html
BibTeX
@misc{reference.wolfram_2025_startprocess, author="Wolfram Research", title="{StartProcess}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/StartProcess.html}", note=[Accessed: 18-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_startprocess, organization={Wolfram Research}, title={StartProcess}, year={2014}, url={https://reference.wolfram.com/language/ref/StartProcess.html}, note=[Accessed: 18-April-2025
]}