RUN s$, mode

RUN StringExpr1 [, mode ]

Description:

This command runs external programs. StringExpr1 should represent the full path and filename of a Windows or DOS executable program, a Liberty BASIC *.TKN file, or a *.BAT file. This is not a SHELL command, so you must provide the name of a program or batch file, not a DOS command (like DIR, for example). Execution of an external program does not cause the calling Liberty BASIC program to cease executing.

Here are two examples:

  'run Microsoft's QBASIC
  run "QBASIC.EXE"

  'run the File Manager maximized
  run "WINFILE.EXE", SHOWMAXIMIZED

  'run winhlp32 with the Liberty BASIC helpfile loaded
  run "WINHLP32 LIBERTY4.HLP"

  'run notepad minimized with a textfile loaded
  run "NOTEPAD NEWFOR403.TXT", MINIMIZE

Command Line - The examples above that run liberty4.hlp and newfor403.txt show how to send information to the executable to be run. If the executable has command line capability, it will use this additional information when it starts up. Notepad will start with the designated file loaded. To insure that a filename is accepted through the command line argument of executables invoked with the RUN command, place such arguments inside of quotation marks. Quotation marks are designated with chr$(34). Be sure to preserve the blank space in the string that occurs between the name of the executable and the additional arguments. Here is an example:

  'run notepad minimized with a textfile loaded
  run "NOTEPAD "+chr$(34)+"c:\program files\my program\MYFILE.TXT"+chr$(34), MINIMIZE

Optional Second Parameter - Notice in the second example you can include an additional parameter. This is because it runs a Windows program. Here is a list of the valid parameters we can include when running Windows programs:

  HIDE
  SHOWNORMAL (this is the default)
  SHOWMINIMIZED
  SHOWMAXIMIZED
  SHOWNOACTIVE
  SHOW
  MINIMIZE
  SHOWMINNOACTIVE
  SHOWNA
  RESTORE