info.mailtraq.com > Management > Script Functions A-Z > Execute() Execute()Calls an external application with supplied parameters. Execute() suspends the script in which it is used until the called application terminates. Use the ExecuteAsync() function if script execution needs to continue immediately.
Although it is possible to send information to the executed application via command line parameters, there is no means for the application to pass information back to the script. However, it may be useful for the application to store information in an external file in a known location, perhaps one passed as a parameter, which the script can then open and read. If this method is chosen the ExecuteAsync() function should not be used because it is uncertain whether the application will have completed writing its output file by the time the script attempts to open it.
Execute( application [ , parameters ] )
- application
- The full path name of the application to execute
- parameters
- The space separated parameters to be passed to application. These are the same as the command-line parameters which might be issued if the application were to be executed from the Windows shell.
Runs the Notepad text editor (assuming that Windows has been installed into the "c:\windows" directory) and provides the filename to open. A more effective text editing example is given for ShellExecute() Execute("c:\windows\notepad.exe", "c:\windows\temp\info.txt") |