By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,582 Members | 1,720 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,582 IT Pros & Developers. It's quick & easy.

Return exit status of console application run as scheduled task

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a

"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

P: n/a
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

P: n/a

"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 discussion thread is closed

Replies have been disabled for this discussion.