473,494 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Return exit status of console application run as scheduled task

VB .Net 2003, .Net Framework 1.1, Windows XP Pro SP1

I've written a console application which I run as a scheduled task. How do
I return an exit status value (or string) from the application so that the
status is displayed in the Status column of the Scheduled Tasks window?

I've tried the following methods, and the console app definitely runs (as
shown by the Last Run Time in the Scheduled Tasks window), however the
Status column is blank.

Sub Main()
Dim ExitStatus As Integer = 10
Environment.ExitCode = ExitStatus
Environment.Exit(ExitStatus)
End Sub

Function Main() As Integer
Dim ExitStatus As Integer = 10
Return ExitStatus
End Function

Thanks for any help or info on this.
Nov 21 '05 #1
3 11840

"John Williams" <jo******************@NOhotmailSPAM.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
VB .Net 2003, .Net Framework 1.1, Windows XP Pro SP1
I've tried the following methods, and the console app definitely runs (as
shown by the Last Run Time in the Scheduled Tasks window), however the
Status column is blank.


The exit code returned is actually shown in the Last Result column. Maybe
the Status is there for the Task Scheduler to set and cannot be set directly
by the application?
Nov 21 '05 #2
On 2004-10-04, John Williams <jo******************@NOhotmailSPAM.com> wrote:

"John Williams" <jo******************@NOhotmailSPAM.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
VB .Net 2003, .Net Framework 1.1, Windows XP Pro SP1
I've tried the following methods, and the console app definitely runs (as
shown by the Last Run Time in the Scheduled Tasks window), however the
Status column is blank.


The exit code returned is actually shown in the Last Result column. Maybe
the Status is there for the Task Scheduler to set and cannot be set directly
by the application?


I believe the status column will tell you if the application is running
or not... In other words, if you open the task sheduler while that
application is running, the status column will say Running.

--
Tom Shelton [MVP]
Nov 21 '05 #3

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:uC**************@TK2MSFTNGP11.phx.gbl...
I believe the status column will tell you if the application is running
or not... In other words, if you open the task sheduler while that
application is running, the status column will say Running.


Thanks for your reply, Tom. I understand what the Status column does now.
Nov 21 '05 #4

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

Similar topics

4
2263
by: Christina | last post by:
Dear All, How can I pop up the windows task scheduler inside of my .net application? Such as I have a button called Schedule Now, after clicking it, the Add Scheduled Task window will pop up,...
1
1256
by: steve | last post by:
it seems that i'm required to hit ENTER in order to exit my console app. this is not very desirable since the app is intended to run as a scheduled task. sub main creates an object that...
20
5355
by: newbie | last post by:
Hi all, http://www.aswin.be/nictransfer.JPG How can I get these numbers with VB.NET ? I thought somewhere in WMI but I can't find them. Thank you, Aswin
2
4466
by: asadikhan | last post by:
I have written a console application that clears out some folders. I want this application to run as a Windows Service (not a scheduled task). What is the easiest way to convert this console...
3
9800
by: Nicol | last post by:
Hi, I have created a console application in c#.net. I also scheduled it in the windows scheduler. In the scheduled task i will specify the command line arguments. When I say "Run", I am getting...
6
8563
by: Krish | last post by:
I want to develop and application that run periodically in the server machine. Now Should I go for a windows service or just create a Console application and schedule it using the windows Task...
2
4165
by: kplkumar | last post by:
Hi all I am fairly new to windows scheduler. I have an .exe console application that needs to be run 1st of every month. I created a scheduled task in Windows Schduler and called the .exe. ...
2
3089
by: Tatter | last post by:
I have a simple .NET 1.1 console application, written with Visual Studio .NET 2003, that needs to be run on a Windows XP system as a scheduled task. When run on its own, the program executes with no...
3
1366
by: =?Utf-8?B?VGVycmFuY2U=?= | last post by:
Good Afternoon: I have two questions I was hoping someone can help me with. 1. I've created a app that creates a xml file; the project was constructed as a console window. I want to know is...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.