473,382 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

creating a scheduled task.

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.

Jul 6 '06 #1
4 3679
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]
ja******@online.microsoft.com
All opinions are my own. All content is provided "AS IS" with no warranties,
and confers no rights.
Jul 6 '06 #2
Jared wrote:
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]
ja******@online.microsoft.com
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

Jul 7 '06 #3
See an article I wrote in August 2004 from http://emoreau.s2i.com/. A
wrapper for the scheduled task is available for download.

--
HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
S2i web inc. (www.s2i.com)
http://emoreau.s2i.com/

"Neil" <ne*****@gmail.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
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.

Jul 9 '06 #4
Hi Éric,
this is just what I was looking for, thank you very much.
Neil
Eric Moreau wrote:
See an article I wrote in August 2004 from http://emoreau.s2i.com/. A
wrapper for the scheduled task is available for download.

--
HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
S2i web inc. (www.s2i.com)
http://emoreau.s2i.com/

"Neil" <ne*****@gmail.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
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.
Jul 10 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Colin Steadman | last post by:
We have a number of scheduled tasks on our IIS server that run daily at some point during the early morning. These tasks run as a specific user that has the correct permissions to perform whatever...
5
by: A. Lovhaug | last post by:
I have a console application built in the .NET Framework. This application basically executes an XCopy based on parameters that I pass to it. I use it for creating scripts for backing up folders,...
2
by: David Olive | last post by:
Hi guys, I'm having a bit of a problem getting a VB .NET console app to run happily as a scheduled task. The app itself generates a bunch of word documents on a file share on another server by...
6
by: John Bowman | last post by:
Hi, I have a C# app that needs to launch the "Add Scheduled Tasks" wizard found in the control panel "Scheduled Tasks" applet. I realize that this "applet" really just opens the tasks folder,...
1
by: satelite | last post by:
Hello, I am writing an exe that is intended to be run via a scheduled task. However, I also need the flexibility to have users run the scheduled task manually (right click task and select run). ...
9
by: helpful sql | last post by:
Hi all, I want to write a .Net solution that I would like to run as a scheduled task in windows. I am not going to need any user interface. What I don't understand is what kind of project I need...
1
by: Myster Edd | last post by:
I have a strange problem that I think deals with security on SQL 2005. I have a scheduled task that runs on a Windows 2000 machine. It calls a vb script which creates a connection to SQL Server. ...
0
by: Paulson | last post by:
Dear Freinds I want to make a program that acts as a reminder for the users.I need to open up the Scheduled task wizard programmatically.If you type Tasks in the run command the Tasks...
9
by: jdaelhousen | last post by:
I have a bit of a problem I'm hoping someone can shed some light on... I have a VB.Net console application written in VS 2003 that produces a .exe file that now sits on a Windows 2000 server...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.