creating a scheduled task.

N

Neil

Hi,
I am having problems in trying to create a scheduled task from within
in application that carries out a health check on a client. I am using
VS 2005.

When the program runs it flashes a command prompt but does nothing.

Dim task As New System.Diagnostics.ProcessStartInfo("schtasks /create
/tn ""Test2"" /tr C:\WINDOWS\system32\calc.exe /sc daily /st 15:14:00
/ru ""System""")
System.Diagnostics.Process.Start(task)

Any help will be gratefully received
Neil.
 
J

Jared Parsons [MSFT]

Hello Neil,
Hi,
I am having problems in trying to create a scheduled task from within
in application that carries out a health check on a client. I am using
VS 2005.
When the program runs it flashes a command prompt but does nothing.

Dim task As New System.Diagnostics.ProcessStartInfo("schtasks /create
/tn ""Test2"" /tr C:\WINDOWS\system32\calc.exe /sc daily /st 15:14:00
/ru ""System""")
System.Diagnostics.Process.Start(task)
Any help will be gratefully received Neil.

Is the application running as a non-administrator? If so this won't work
because you have to be an admin to run schtasks.

Otherwise what is the return code of schtasks?
 
N

Neil

Jared said:
Hello Neil,
Hi,
I am having problems in trying to create a scheduled task from within
in application that carries out a health check on a client. I am using
VS 2005.
When the program runs it flashes a command prompt but does nothing.

Dim task As New System.Diagnostics.ProcessStartInfo("schtasks /create
/tn ""Test2"" /tr C:\WINDOWS\system32\calc.exe /sc daily /st 15:14:00
/ru ""System""")
System.Diagnostics.Process.Start(task)
Any help will be gratefully received Neil.

Is the application running as a non-administrator? If so this won't work
because you have to be an admin to run schtasks.

Otherwise what is the return code of schtasks?

--
Jared Parsons [MSFT]
(e-mail address removed)
All opinions are my own. All content is provided "AS IS" with no warranties,
and confers no rights.

Hi Jared,
I had the application running as a non-administrator but schtasks
still does not return an error code.
thank you for help
Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top