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.

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 '20 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.