WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Error Codes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

RunWait Failing: Segment Load Failure

Keywords: RunWait Failing Segment Load Failure

Question:

When using RunWait, why does WinBatch continue before the program has finished loading?

Answer:

The @wait flag simply holds the next WIL instruction until the EXE launched by RunShell has completed. Note: This can be fooled by what we call the "loader program problem". For testing purposes, add a message statement immediately after the RunWait or RunShell(..@wait) statement to verify that the message box pops up at the expected time. If it pops up early, then you are probably dealing with a loader program problem.

Many programs now have "Loader" programs which call the REAL EXE, launch it and then exit. When the "Loader" EXE exits, WinBatch continues with the script. Then, if your next command is a detach, the network connections are being deleted before the REAL EXE has had a chance to finish loading. This can cause a "Segment Load Failure", or at the very least doesn't work as expected.

You can fix this in one of two ways:

  1. Find out the real name of the EXE. You can launch the WinBatch.exe, from there you can select "Determine Owning EXE File" from the list of options. Put the mouse pointer on the program and the dialog box will display the REAL EXE name. Then use this EXE name in the AppWaitClose function, as follows:
            Run("xxx.exe", "")
            delay(3)
            AppWaitClose("EXEname.EXE")
    
  2. Instead of using RunWait, use a Run function in conjunction with a WinWaitClose.
            Run("xxx.exe", "")
            delay(3)
            WinWaitClose("MainWindowName")
    

Another Segment Load Failure Question:

Why am i getting a wbcmpl16l.dll cause segment load failure in wbdbfl16i.dll 0008:00002286 error?

Answer:

Because either your script or something else is breaking a network connection between the compiled winbatch script and its DLL. Make sure you're putting the WinBatch DLL in the same directory as the compiled WinBatch EXE so that WinBatch can find its DLL.
Article ID:   W12980
Filename:   RunWait Failing Segment Load Failure.txt
File Created: 1999:04:15:16:50:56
Last Updated: 1999:04:15:16:50:56