Click here to Skip to main content
15,667,422 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)

I have a requirement where I need to create a jar file that invokes selenium scripts. I want to make jar file a job every 5 mints and should disable job if the selenium scripts are running.

if selenium scripts run more than 5 mints then I should disable job until selenium scripts complete else job should run every 5 mints.

I have created a task in task Scheduler where I am calling this jar file every 5 mints.

Is there any way where I can disable the task once I start executing jar and enable it when it completed executing.

What I have tried:

I have created a jar file and created a task in the task scheduler every 5 mints.
Updated 11-Oct-19 7:44am
Richard MacCutchan 11-Oct-19 4:28am    
What does the code do and what is the problem?

1 solution

You can create and change tasks using the command line, I used this in a C# application and it works fine. I find this a lot easier than using complicated libraries that probably will be out of date when a new Windows version is released.
How to create scheduled tasks with Command Prompt on Windows 10 | Windows Central[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900