Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: <200010061542.e96FgXY03129@laxmls02.socal.rr.com> X-Sender: cloder AT pop-server DOT socal DOT rr DOT com X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0 Date: Fri, 06 Oct 2000 08:45:12 -0700 To: Paul Boniol From: Chad Loder Subject: Re: Starting as Service on NT Cc: cygwin AT sourceware DOT cygnus DOT com In-Reply-To: <39DDAC62.A169C55D@turbosport.com> References: <39DD656F DOT 367CC8F5 AT turbosport DOT com> <001701c02f59$69a304e0$ff2dacac AT timayum4srqln4> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Note-from-DJ: This may be spam This is very easy to do, in fact. Just write the service as you normally would (check out Richter's book), then add it to your registry in the appropriate place (there's a registry key somewhere under HKLM where you put the name of the executable and a couple other params), then in your Services Control Panel, just go to the "Log On As" section and put in there under what user context you want the service to run under. This can all be done programatically as well, by looking up the SID of the user and sticking THAT in the registry, although I've never done it. Note that a BAT file cannot itself be a service. Windows NT has a particular API you must implement (called a "Service Control Program") where you have to respond to events like start-service, stop-service, and pause-service within a certain amount of time. However, it's rather trivial to write a C program which invokes a BAT file via the shell. c At 05:41 AM 10/6/2000 -0500, you wrote: >From my limited understanding of NT (mostly familiar with 9x), I don't >think this would work since noone is logged in when the computer >restarts. I'm thinking it would have to be something like 9x's AUTOEXEC.BAT >or a service listed in the registry. I don't know much about NT specifics. >Does it do something like AUTOEXEC.BAT? If it does, would putting Cygwin >in there stop NT from booting until Cygwin exited? (Must get some sleep now. >Hope this made sense.) > >Paul > >Tim Prince wrote: > >> Did you try putting a copy of cygwin.bat in the startup folder? Or do you >> mean something else? >> ----- Original Message ----- >> From: "Paul Boniol" >> To: >> Sent: Thursday, October 05, 2000 10:38 PM >> Subject: Starting as Service on NT >> >> > I would like to get Cygwin to start automatically as a service >> > on Windows NT server (i.e., when it boots up) under a particular >> > user's account. Anyone know how to do this? >> > >> > Thank you, >> > Paul > > >****** >Get free pop3/imap/web-based e-mail with smtp support, 40 megs of space, >autoresponders, forwarding, and more at http://www.turbosport.com, >http://www.webmailcity.com, or http://www.mailplanet.net. >Also sign up for free paging service! >****** >To report SPAM mail please send an e-mail to spam AT turbosport DOT com. > >Be unique at NamePlanet! firstname AT lastname addresses! > > > >-- >Want to unsubscribe from this list? >Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com > -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com