Let's now call this method into the main method.
Publish & create EXE
Once the above code is completed and executed, the following 3 files will be created.
Create Task Scheduler
For performing autorun operation, we need to set one task scheduler.
Open task scheduler
Click Create Task which is present on the right side of the screen, as shown in the image.
The following window will open.
Here, we can give a meaningful name to the task scheduler and in another tab, set trigger.
Choose the frequency as - one time, daily, weekly, or monthly as per your requirement. Set an appropriate time check Enabled check box. In the next tab, we will set action, i.e., start EXE file (or set appropriate action as per your requirement).
Choose action and select path of the exe file.
Your task scheduler is ready to use.
Thank You.