vuShellEx(pFile, pParams, pWork, ShowCmd)
vuShellEx(*CSTRING pFile, *CSTRING pParams, *CSTRING pWork, LONG ShowCmd), LONG
Description
Launches a file using the Windows shell with optional parameters, working directory, and window display options.
| Function |
Separate File/Params |
Working Folder |
Delay |
Wait |
Notes |
| vuShell |
No |
No |
No |
No |
Simple shell launch that honors Windows file associations. |
| vuShellDelay |
No |
No |
Yes |
No |
Shell launch after a startup delay. |
| vuShellEx |
Yes |
Yes |
No |
No |
Preferred shell launch when you want file and parameters passed separately. |
| vuShellExDelay |
Yes |
Yes |
Yes |
No |
Shell launch with separate parameters plus startup delay. |
Parameters
| Parameter |
Data Type |
Description |
| pFile |
CSTRING(260) |
Full path to the file or executable to launch. |
| pParams |
CSTRING(260) |
Optional command-line parameters. |
| pWork |
CSTRING(260) |
Optional working directory. |
| ShowCmd |
LONG |
Window display option (see ShowWindow constants, for example 1 = normal window). |
Note: In vuFileTools V5, CSTRINGs are not limited to the sizes shown above. The numbers are for example only.
Returns
A LONG value indicating the result:
- 1 if the file launched successfully
- 0 if the launch failed
- Negative values may indicate a Windows shell error
Example
FilePath CSTRING(260)
Params CSTRING(260)
WorkFolder CSTRING(260)
ShowCmd LONG
Ret LONG
FilePath = 'C:\Temp\Readme.txt'
Params = ''
WorkFolder = ''
ShowCmd = 1
Ret = vuShellEx(FilePath, Params, WorkFolder, ShowCmd)
Notes
vuShellEx honors file associations, so documents open in their registered Windows applications.
- Use this when you need shell behavior plus explicit parameters or a working folder.