Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 598
  • Last Modified:

Get exit code from VB exe?

How can I return an exit code from a vb 6 exe? One that could be trapped from another program or .bat errorlevel?
0
gferrell
Asked:
gferrell
  • 2
  • 2
1 Solution
 
hesCommented:
Use this

Declare
Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)

When you want to exit
ExitProcess 50& 'this returns a 50 for a 1 use
ExitProcess 1&
0
 
gferrellAuthor Commented:
In you experience, does this cause a problem since this command is unsupported in vb?
0
 
hesCommented:
<<command is unsupported in vb? >>

How do you mean unsupported ? It is a Windows API
0
 
gferrellAuthor Commented:
unsupported in vb...I guess vb likes to close its own way:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q288216

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now