TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tulika Kumar
1.7k
14
20.9k
How to get Environment.ExitCode value from the Command line
Oct 29 2013 5:34 PM
I have a Winform application which can be run in GUI mode as well as in command prompt.
In the command prompt, I basically call appropriate button depending upon the given command line argument. For example: "C:/> MyTool param1" will call Button1_ClickEventHanlder() internally
In this Button1_ClickEventHandler() method, I set
Environment.ExitCode
to some value depending upon some conditions.
My question is how to get Environment.ExitCode value from the Command line in a winform app?
I tried
echo %errorcode%
after running my app from command prompt but no luck, it's always giving 0. Even I tried "
start /wait MyTool param1" too but it's not giving proper ExitCode value what it's supposed to give as per code logic.
Please help me to resolve this issue.
Reply
Answers (
2
)
File uploader validations
C# windows Form applicaion - ComboBoxes - Urgent Help Please