cmd: How to execute command in background?

M

Me

In a DOS window (click on Start / Run and enter "cmd"),
how do I execute a command in background?

In UNIX, I would do "nohup foobar >out.txt 2>err.txt &".

What is the equivalent in "cmd"?

The "nohup" ensures that "foobar" continues to run,
even if the "cmd" window is closed.

I presume I could use Task Manager to kill the command
later.

How do I direct output to the bit bucket?

In UNIX, I would do ">/dev/null".
 
T

Torgeir Bakken \(MVP\)

Me said:
In a DOS window (click on Start / Run and enter "cmd"),
how do I execute a command in background?

In UNIX, I would do "nohup foobar >out.txt 2>err.txt &".

What is the equivalent in "cmd"?

The "nohup" ensures that "foobar" continues to run,
even if the "cmd" window is closed.

I presume I could use Task Manager to kill the command
later.

No such exact thing exists for Windows, but Soon.exe (Command
Scheduling Utility) is an option maybe. Type Soon.exe /? for help.

How do I direct output to the bit bucket?

In UNIX, I would do ">/dev/null".

This will send StdOut and StdErr to the bit bucket:

(the 2> part is for StdErr)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top