?
Solved

start scheduled task in .net

Posted on 2010-11-17
2
Medium Priority
?
493 Views
Last Modified: 2012-05-10
hi,

I'm triying to create a scheduled task from .net

Dim process1 As New System.Diagnostics.Process()
process1.StartInfo.FileName = "C:\WINDOWS\system32\schtasks.exe"
process1.StartInfo.Arguments = "/CREATE /TN ""name-of-task"" /TR name-of-program.exe /SC once /SD 02/11/2010 /ST 08:42:00 /TU system"
process1.Start()
process1.Close()

but the tast is not created, does any one have an idea?


                'System.Diagnostics.Process.Start("C:\WINDOWS\system32\schtasks.exe", "/CREATE /TN ""mailsender999"" /TR c:\program files\mailsender\mailsender.exe /SC once /SD 02/11/2010 /ST 08:42:00 /TU system")

                process1.Start()
                process1.Close()
0
Comment
Question by:reinoutkool
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 1000 total points
ID: 34156636
0
 

Author Closing Comment

by:reinoutkool
ID: 34170196
got it to work with code below:

Dim process1 As New System.Diagnostics.Process()
process1.StartInfo.FileName = "schtasks"
process1.StartInfo.Arguments = "/CREATE /TN ""name-of-task"" /TR name-of-program.exe /SC once /SD 02/11/2010 /ST 08:42:00 /TU system"
process1.Start()
process1.Close()

will keep the class in mind, tnx
0

Featured Post

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question