Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 10 Jul 2002 22:21:44 +0100 From: "Jim.George" X-X-Sender: Administrator AT gateway DOT george DOT co DOT uk Reply-To: jim DOT george AT blueyonder DOT co DOT uk To: Dave cc: cygwin AT cygwin DOT com Subject: Re: Running Cygwin as a serivce and automatically executing a script In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Dave, why not execute /usr/bin/perl with myperl.pl as the command line prompt? In other words don't worry about the rest of the bat file. Is it myperl.pl that uses the /tmp directory? Have you tried amending your perl script to use the full path for /tmp, i.e. /cygdrive//tmp HTH, Jim On Wed, 10 Jul 2002, Dave wrote: > After Spending a few hours hunting through mailing list archives and reading > the FAQ inside and out, I have decided to make a post to the list. > > The Question: > > I want to run Cygwin as a service on Windows 2000 Professional with service > pack 2 and get Cygwin to automatically run a script (in this instance a Perl > script). > > Getting Cygwin to run as a service (that runs for any users) is not a > problem, I am currently using FireDaemon (http://www.firedaemon.com/) and > linking to a batch file, setting C:\cygwin as the working directory and > C:\cygwin\mybatfile.bat as the execution file. > > The batch file is loaded as intended every time the machine is turned on, > however Cygwins behaviour is odd. > > The batch files contains: > > C: > chdir C:\cygwin\bin > bash --login -i > CD ~ > CD mydir > perl myperl.pl > > When I run the batch file normally it gets as far as opening the bash, using > the currently logged in user (which happens to be administrator). > > When run as a service (with or without the service set to run as > administrator) it loads the bash, but the bash reports it cannot find the > /tmp dir. And it stops execution. > > In both instance the script is not loaded. > > I am not very experience with either Unix or Cygwin, so any help would be > great J > > What I am trying to actually do? > > The reason I wish to run it as a service is to hide the Cygwin window, as I > use the machine its on for many other things and having the bash window on > the taskbar is a pain, as its not actually doing anything, once the script > has been run. > > If there is another way to load a script automatically and hide the Cygwin > window, I am all ears. > > Direct Contact: dave AT shadowxj5 DOT co DOT uk - Dave > > > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/