docs

Home All functions Categories

vuRun(Filename, WStyle, Wait)

vuRun(*CSTRING,LONG,LONG), Signed

Description

Build 210 improves reliability with longer command lines and supports launching executable programs and .bat or .cmd scripts.

The Filename parameter is one command line string containing the executable (or script) and optional arguments. Quote an executable or script path containing spaces. Use the vuShell family for opening documents or URLs via Windows file associations.

Parameters

Parameter Data Type Description
Filename *CSTRING Fully qualified path and filename of the program to run. May also include runtime parameters in the same string.
WStyle LONG Window style for execution:
0 = Hidden
1 = Normal with focus
2 = Minimized with focus
3 = Maximized with focus
4 = Normal without focus
6 = Minimized without focus
Wait LONG Execution wait flag:
0 = Return immediately and do not wait for completion
1 = Wait until the program completes

CSTRING size note: CSTRING(1024) is an example caller declaration, not a 256-character limit. The Build 210 implementation has a 32,768-byte local command buffer including the null terminator and rejects oversized input rather than truncating it. Windows command-line, executable-path, ANSI/codepage and cmd.exe (batch script) limits still apply. See CSTRING Sizes and Buffer Capacity.

Returns

A SIGNED value:

Important: A return of 1 does not indicate that the launched program completed successfully. It does not report that program’s exit code.

Example

Filename CSTRING(1024)
WStyle   LONG
Wait     LONG

Filename = 'C:\Windows\Notepad.exe mydoc.txt'
WStyle   = 1   ! Normal with focus
Wait     = 1   ! Wait for program to complete

IF vuRun(Filename, WStyle, Wait)
  MESSAGE('Program executed successfully.')
ELSE
  MESSAGE('Failed to run program.')
END

Notes

Filename = '"C:\Program Files\MyApp\MyTool.exe" /x /y'
Home All functions Categories