In fact I have installed cygwin on windows server 2016, and my scripts run perfectly inside bash terminal.

Now I want to schedule my scripts to run per day using windows task scheduler.

So I have created a new task:

Action: start a program

Program/Script: C:\cygwin64\bin\bash.exe

Add arguments: "/home/administrator/myscript.sh"

And finally I triggered it everyday.

But it's not working, last run result I get (0x41303)

It's the first time I'm using task scheduler with cygwin, otherwise crontab is much easier.

Can you guys help me out.

1 Answer 1

C:\cygwin64\bin\bash.exe -c "/home/administrator/myscript.sh"

But, you might need to set some environment things, so you might want to test above first from the command-prompt.

  • Hi, worked perfectly. on arguments: -c "home/administrator/myscript.sh" Thanks Apr 30, 2020 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .