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

Called WBTs and WBCs

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

Passing Information Between WinBatch Exe's and Calls

Keywords:  passing parameters EXEs EXE's Calls dynamic parameters

There are (at least) five ways to pass information from a called WinBatch WBC 
back to the calling WinBatch EXE:
  1. Via an INI file (IniWrite[Pvt] / IniRead[Pvt])
  2. Via a text file (FileWrite / FileRead)
  3. Via a file name (FileCopy or FileRename / FileExist)
  4. Via the clipboard (ClipPut / ClipGet)
  5. Via a window (Display or Message / MsgTextGet)

Each method involves a write/read function pair (shown in parentheses): first the called EXE places the desired information in an accessible location using the "write" function, then the calling EXE retrieves the information using the "read" function.

Here is an example using the first (INI) method, since it's easy, clean, efficient, and safe:

Example:

  ; MAIN.WBT (which can be compiled to an EXE)
  number = AskLine("SquareIt", "Please enter a number:", "")
  If number == "" Then number = 0
  RunWait("squareit.exe", number)
  result = IniRead("SquareIt", "Result", "")
  Message("SquareIt", "%number% squared is %result%")

  ; SQUAREIT.WBT (which should be compiled to SQUAREIT.EXE)
  square = param1 * param1
  IniWrite("SquareIt", "Result", square)  

Article ID:   W12998
Filename:   Passing Info from WinBatch EXEs to Calls.txt
File Created: 1999:04:15:16:51:04
Last Updated: 1999:04:15:16:51:04