![]() |
![]() |
![]() |
Windows Console question Unix shells allows to run apps in background.
Michael Popov
Use the start command.
Almost Anonymous
Thanks.
Michael Popov
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?
Almost Anonymous
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.
Almost Anonymous
Cygwin's Cygrunsrv allows arbitrary processes to be started as a service.
Michael Koziarski
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.
mb
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 :)
Michael Popov
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.
Raj Chaudhuri
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.
Rhys Keepence
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.
Joe
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
Matt Watson
|