Results 1 to 2 of 2

Thread: Getting the return code from a shelled DOS program

  1. #1

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    I am executing a DOS program from my VB app (as an alternative to Shell, I am using various API processes that I found on this forum to make it run synchronously). That part is fine. What I haven't yet been able to find is the necessary to code to read a return code back from this program (for example, if I was running a DOS BAT file, I could test this return code with ErrorLevel). Can I do the equivalent of test for errorlevel in my VB app? TIA
    "It's cold gin time again ..."

    Check out my website here.

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898
    you should be able to shell out using the waitforsingleobjectapi. On return if it succeeded then the return code will be 0 if it failed then the return code will be somthing else.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width