Solved

start scheduled task in .net

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

770 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