Shell_Execute
Description
Section titled “Description”Executes specified program/command using specified options
Syntax
Section titled “Syntax”Shell_Execute(sProgram, sArgument, bWait, iStyle, bCheckProgramExistence) As Boolean
Parameters
Section titled “Parameters”sProgram (String)
Section titled “sProgram (String)”Program/command to execute
sArgument (String)
Section titled “sArgument (String)”Command line arguments
bWait (Boolean)
Section titled “bWait (Boolean)”Wait for termination before proceeding
iStyle (Integer)
Section titled “iStyle (Integer)”Windows Style Constants (e.g minimized or normal)
bCheckProgramExistence (Boolean)
Section titled “bCheckProgramExistence (Boolean)”Check for existence of the program. If TRUE and sProgram isn’t an existing file, the function returns FALSE. Set it to FALSE for commands that aren’t a full file path, for example cmd.exe /c ....
Return value
Section titled “Return value”Boolean, TRUE if the program was started. If bWait is TRUE, giErrorLevel contains the exit code of the program. The function doesn’t fail when the exit code isn’t 0, so check giErrorLevel yourself. If bWait is FALSE, giErrorLevel is 0.
Example
Section titled “Example”If bStatus Then bStatus = Shell_Execute(gsWindowsDir & "\Regedit.exe", gsTempDir & "\Regfile.reg /S", True, 1, True)