Jump to content
  • LaunchCmd


    VBScript   → Lua


    This function calls (launches) a given command, i.e. launches any given application.

    Please see the Introduction chapter for some usage instructions.


    ' LaunchCmd
    ' Calls/launches the given command
    ' Parameter:
    '   sCommand            command to be called
    ' Return:
    '   none
    Function LaunchCmd( sCommand )
        PBXScript.OutputTrace "------> LaunchCmd ( " & sCommand & " )"
        On Error Resume Next
        Dim objShell
        Set objShell = CreateObject("WScript.Shell")
        objShell.Run sCommand
        If Err <> 0 Then
            PBXScript.OutputTrace "Error executing the given command! (" & Hex(Err) & ")"
            PBXScript.OutputTrace Err.Description
            PBXScript.OutputTrace "Given Command successfuly executed"
        End If
        Set  objShell = Nothing
        PBXScript.OutputTrace "<----- LaunchCmd"
    End Function


    Please note that this command will be launched on the SwyxServer machine. No windows will be opened, and no user input can be made. So only start command line applications which do not require any user input.


    As the call routing is executed by the Swyx Server service, the command will also be executed by the Swyx Server service. That means, it is executed by the Windows user, the Swyx Server service is running under (usually this is the local SwyxServiceAccount user). 

    This function makes use of the Server Script API function PBXScript.OutputTrace to write trace information into the SwyxServer trace file.


    This function was initially posted into this forum topic.



    Tom Wellige


    User Feedback

    Recommended Comments

    There are no comments to display.

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.