docs

Home All functions Categories

vuRun(Filename, WStyle, Wait)

vuRun(*CSTRING,LONG,LONG), Signed

Description

Runs a program using the Windows Shell with the specified window style and wait behavior.

The Filename parameter is passed as a single command line string. This means it can contain the fully qualified path to the program followed by any runtime parameters.

Function Separate File/Params Working Folder Delay Wait Best Use
vuRun No No No Yes Simple or legacy command-line launch with optional wait
vuRunDelay No No Yes No Simple delayed launch
vuRunEx Yes Yes No No Preferred modern launch with separate parameters
vuRunExWait Yes Yes No Yes Modern launch with separate parameters and wait
vuRunExDelay Yes Yes Yes No Modern delayed launch with separate parameters
vuRunExDelayWait Yes Yes Yes Yes Modern delayed launch with separate parameters and wait
vuRunExists No No No No Open a file or app only if the target already exists
vuRunExistsEx No No File wait No Wait for a file to appear, then open it

Parameters

Parameter Data Type Description
Filename CSTRING(256) 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

Returns

A LONG value:

Example

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