Jump to content
Tom Wellige

Function: LaunchCmd

Recommended Posts

This post is taken from the Swyx Forum Archive (2007-2014) and was originally posted 08.07.2010 by me


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

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 and user input.

To use the function within your call routing script just copy&paste it into the "Start" block and call it afterwards within an "Evaluate" bl


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


This function was originally posted with the name "CallExternalApp" in the forum.


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.