Environment.ExitCode Property gets or sets the exit code of the process.
Imports System Class Sample Public Shared Sub Main() Console.WriteLine("ExitCode: {0}", Environment.ExitCode) End Sub 'Main End Class 'Sample