Windows Console question
Unix shells allows to run apps in background.
Use the start command.
When I use start on a console application a new console is opened that is independent of the first console (ie I can close it). Same is true of native Windows applications (except no console is created). What version of Windows are you using?
There is a tool (I forget it's name) that will let you turn any Windows application into a service. You just run it from the command line and it installs the process as a service.
Cygwin's Cygrunsrv allows arbitrary processes to be started as a service.
also srvany or some similar name which is part of the windows resource kit somewhere. i plan to use it to run cruisecontrol.net sometime soon.
It's both a plus and a minus that Microsoft decided to force programs to specifically cope with the idea of becoming a service.
Brad Wilson (dotnetguy.techieswithcats.com)
Well, as usual it is simpler to write it by myself :)
The Start command seems to work for me. I can kill the original console, and the started application keeps running. I use Windows XP SP1.
Yep, but if you close the spawned console, the process dies off. The OP is asking how processes can be run similar to a Windows service or the unix '&' command.
OS/2 has a "detach" command which does this. When I found I needed this during a port from OS/2 to NT I wrote my own in C.
If you schedule a job to run your task as a different user (still with the same rights), you shouldn't see the console windown. We do this all of the time because we have to run scripts that we do not want the users to see
Fog Creek Home