Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In linux we just need to append a & and that's all.

What for windows?

share|improve this question
    
You just exploring, are is there something in particular you are trying to get done? –  Kyle Brandt Mar 12 '10 at 19:04

4 Answers 4

start /min cmd /c mycommand

If you want to run other jobs in the same shell you have to use powershell background jobs

If you want to hide the command window save a vbscript file with the following code(replacing the commands as needed) :

Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run chr(34) & "C:\mycommand_path\mycommand and args" & Chr(34), 0
Set WshShell = Nothing

create a shortcut to this file and run this from the shell directly by double clicking it. It sounds like what you are really after is job control. Install the subsystem for unix to get the bash or ksh prompt and execute it from there if you want job control however it would not suprise me if running it as a background job causes issues. You will probably want to run it as a background process instead.

share|improve this answer
    
I tried this but not work:start /min cmd php file.php args /c,file.php is not run –  vps Mar 12 '10 at 18:56
    
I wouldn't consider this the equivalent of running a process in the background. –  Warner Mar 12 '10 at 18:57
    
@vps try start /min "cmd /c php file.php args" –  Jim B Mar 12 '10 at 19:05
    
This is minimize,not background –  vps Mar 12 '10 at 19:20
    
@Warner, it's a process in the background, what's your definition of background process? If you want job control (which is a posix/unix concept) that is a different concept and you would want to enable the posix windows shell. Powershell is the only job control enabled shell other than the posix shell that microsoft makes. –  Jim B Mar 12 '10 at 20:00

This is called job control in the *nix world. Job control is a required feature of a POSIX shell.

For Windows, I found this post about some equivalents..

share|improve this answer

There is no equivalent. You could install cygwin and do the same thing. Or you could make a service that runs your application : srvany or other tools will do this for you. Keep in mind that not all Windows applications will properly run in these ways.

share|improve this answer

You can use HStart for this purpose, it allow to run a command in background .

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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