In Windows 10, I have created a scheduled task using SCHTASKS command to run a node.js file in every 10 minutes using a .bat file. I have used git bash to write that command.
Here is my SCHTASKS command:
schtasks //Create //sc minute //mo 10 //tn "Repeat_10Check" //tr \\runnode.bat
My .bat file is located in root directory i.e. C:\Users\username.
My .bat file's name is runnode.bat
I want to run example.js file which is located in F:\Nodejs\project\subfolder directory, using that .bat file by running the following command:
SCHTASKS //RUN //TN "Repeat_10Check"
Normally in git bash i would write following command to run a node.js file:
cd ../../../F/Nodejs/project/subfolder
node example.js
What should i write in runnode.bat to execute those command using the batch file ?