Solved

start scheduled task in .net

Posted on 2010-11-17
2
491 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 70

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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