Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

application exit and code

Status
Not open for further replies.

mrmovie

Technical User
Oct 2, 2002
3,094
0
0
GB
vb.net, app runs Sub Main()
want to exit app from Sub Main with exit code

have tried

Environment.ExitCode = 1
Environment.Exit()

and

Environment.ExitCode = 1
Environment.Exit(1)

and
Application.Exit() doesnt even exit the app!!!

all of the above still return an error code on 0 in the dev environment and if i start the exe from dos and return %errorlevel%...what am i doing wrong? please

regards,
richard
 
does anyone know how to close a vb.net app and return an error? i would have thought this would be one of the more fundamental issues, ive done a keyword search on it but havent found anything to help me...any ideas?

thanks
mrmovie
 
total lie, its seems to be working when returning from vbscript file to launch exe
 
I've tried the same thing. We use CMD scripts to run processes and want to use Envoronment.Exit(x) to return an error condition. No matter what number I use for x, I always get back 1 in the %ERRORLEVEL% variable in the CMD script. If anyone can help, please feel free to respond.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top