This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question with cygwin.bat and Windows Scheduler


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]