Solved

start scheduled task in .net

Posted on 2010-11-17
2
487 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
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 250 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now