Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Does anyone have an idea how you are able to program a Task via VB.NET to automatically let it execute in Task Scheduler?

I received an assignment from my teacher (it's a tough one for me), and I have to design a program in Visual Basic Express, so it would copy some files from one place to another (that's not that tough, I think), but it has to be done on a specified time ...

And as I recall, you are able to do this with Task Scheduler from Windows itself, right? But this is were the problem starts showing up ... in the assignment, I'm not allowed to use the Task Scheduler physically ... I have to program it somehow so "the program" would put itself or schedule itself in Task Scheduler.

How on earth do you do this?

And as a finishing touch, I have to send an e-mail to my teacher with the results of my program (wether it's finished, still running or inactive).

PLEASE, someone help me! I'm stuck for sure ... And it's sort of my year assignment ... So it would be really helpfull if someone could help me out.

Thanks alot!

Jorre
Posted

create a windows service based om a timer event: http://www.devtips.net/Artikel.aspx?id=38[^]
 
Share this answer
 
You know using the Task Scheduler can be done, more elegant solution. It also could be done via your program or windows service. You could store the data in an xml file and your program can parse it via a timer.
 
Share this answer
 
I fixed it anyway :)

this was the code that made it possible

Process.Start("schtasks","/create /sc once /sd [date] /st [time] /tn [Name] /tr [trigger]")

and for the mail, thanks to VBScript, it worked out just fine.
 
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