delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/09/22:03:11

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <27095212.post@talk.nabble.com>
Date: Sat, 9 Jan 2010 19:02:46 -0800 (PST)
From: aviate <richards DOT mikes AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: question with cygwin.bat and Windows Scheduler
In-Reply-To: <4B494098.4040706@monai.ca>
MIME-Version: 1.0
References: <27094829 DOT post AT talk DOT nabble DOT com> <4B494098 DOT 4040706 AT monai DOT ca>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

thanks for your help here.

I was avoiding cron...but it might be most useful here.  Is there any way to
hide the window popping up by Windows Scheduler??



Steven Monai-5 wrote:
> 
> On 2010/01/09 5:36 PM, aviate wrote:
>> 
>> Hi...tried for a long, long time trying to make this work to no
>> avail...and
>> did not find help online.
>> 
>> Using Windows XP, I am running a bash script via the windows task
>> scheduler,
>> which is calling Cygwin.bat ...The command being tasked is:
>> 
>> C:\cygwin\Cygwin.bat /myfolder/myscript.sh
> 
> You're using 'Cygwin.bat' in a way it wasn't meant to be used.
> 'Cygwin.bat' is for opening an interactive shell in a Windows console
> window, not for running arbitrary bash scripts.
> 
> Instead, create a separate .bat file to run your bash script. The
> following two-liner should do the trick:
> 
> @echo off
> C:\cygwin\bin\bash.exe --login -c "/myfolder/myscript.sh"
> 
> Name the file something like "myscript.bat", and schedule it to run in
> Task Scheduler. Now every time it runs, a console window will open, and
> within it you'll see your bash script's output. The window will
> automatically close when the bash script exits.
> 
> Finally, you may want to look into using Cygwin's 'cron' package instead
> of Task Scheduler. One benefit of using cron is that you won't get a
> console window popping open every time the script runs.
> 
> HTH,
> -SM
> --
> 
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/question-with-cygwin.bat-and-Windows-Scheduler-tp27094829p27095212.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019