I'd like to run a particular application (let's call it foo
) from the command line, but I don't want it holding up the terminal, putting any junk in the terminal from its output or error streams, and also want it to keep running even if I close said terminal. In Bash, I can do that using (foo &>/dev/null &)
, but I don't know how I would do that in Windows shell. Could someone please help me?
Windows – Equivalent of (foo &>/dev/null &) in Windows shell
command lineshellwindows
Best Answer
The way you would do this in Windows is:
The
start
command will start a detached process, a similar effect to&
. The/B
option preventsstart
from opening a new terminal window if the program you are running is a console application (it is unnecessary for GUI applications). The>
has the same meaning as in Linux, andNUL
is Windows' equivalent of/dev/null
. The2>&1
at the end will redirect stderr to stdout, which will all go toNUL
.