Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.44/5 (3 votes)
Hi Frenz!!


I want to create one Task Scheduler using C# same as Windows Task Scheduler, to run my .bat (batch) file on particular time.

I found below useful link (TaskScheduler[^])

in this they schedule trigger, and i want to Schedule my .bat file
I mean while i am trying to give my batch file path in tags textbox, its just fired trigger, not run my batch file
so, i modify that code little bit, and now I am able to run my batch file also,

but, when i close my application triggering also stop,
so, is there any way i can triggering or run my batch file even if i close my application liks window task scheduler???




kindly Help me .

Note: its desktop application using C#
Posted
Updated 19-Jul-13 21:17pm
v3
Comments
_Asif_ 19-Jul-13 3:07am    
Whats wrong in using the triggers? Please note that this is not a database trigger.
Varun_nayak 19-Jul-13 4:10am    
means? I thought it was database trigger!!
how can i add my .bat file in this program???
_Asif_ 19-Jul-13 4:57am    
No it is not a database triggers. You have not even look at the demo and code. Its all there you just need to tweek
Varun_nayak 19-Jul-13 5:29am    
i give my batch file path in tags textbox,so, its just fire trigger, not run my batch file, So,
i am looking for how to run my batch file
[no name] 19-Jul-13 6:42am    
1. Why are you not asking the person that wrote the code your question?
2. Why are you unable to just give the task scheduler the path to your batch file?

1 solution

 
Share this answer
 
Comments
Varun_nayak 20-Jul-13 3:11am    
hey thanks for ur link.

using this method my trigger not only fire but also my batch file run according to scheduling,
but,its not run when i close my window application close like windows task schedule,
so, is there any way so , i can schedule my batch file even it i closed application
Richard MacCutchan 20-Jul-13 3:58am    
Well there is no way it can be scheduled if your application terminates. If you want this to happen repeatedly then you would have to create a service program to do it. However, since Microsoft already provides the Windows Task Scheduler you are merely duplicating what is already there.
Varun_nayak 20-Jul-13 4:15am    
ya you are right, but in corporate level we can't ask our employee to use window task schedule to run batch file(batch file call another application),
so, I am looking for a logic to call window task scheduler from my desktop application,
or just want to make application like it.
Richard MacCutchan 20-Jul-13 4:52am    
Take a look at these suggestions.

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