Can we run shell commands in Windows in background and check later whether it is still running or not?

For example, we have "screen" command in linux. Is there any other way for that too? In addition to this is there any other way to run commands in background in linux other than the screen command?

Actually, I am running the command, which when executes, displays it's own terminal, so I run it via screen command, to check it later.

  • Sorry for my poor english – Hunzla Feb 4 '15 at 20:51

Linux Alternatives:

$ sleep 10 &

Sleeping 10 seconds in the background, creates a so-called job. With

$ jobs

you can list every jobs you have created.

$ fg 'jobnumber'

Fetches the selected job back to foreground.

In Windows:

In Windows the keywoard is powershell: You can create a Job:

$ Start-Job -Name MyJob -ScriptBlock{Get-Process}

Above command creates a Job which executes the Commands in the brackets {...}.

$ Get-Job

lists information like the state and ID of every Job you have started.

Receive-Job -Id number

shows the output, which the job has produced.

  • Just noticed, that the post is already old :-0 – h0ch5tr4355 Sep 21 '15 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.