Purpose
Runs an executable program on the server.
Programs run on the server can have command line arguments passed to them, but no additional input can be provided to the running program.
Operating system shell commands can also be run from this function. Shell returns an integer value that is the command interpreter's error code. 0 indicates that the command interpreter was able to begin processing the request. Non-zero indicates an error.
Note
The Spawn function has several advantages over Shell, and should be used in place of Shell where possible.
Syntax
Shell (StringExpression)
StringExpression |
The full path and executable name of the program to be run on the server. |
Example
Sub Main()
Dim rc As Integer
rc = Shell ("Copy C:\FCPO\LogFiles\*.* C:\Backup\LogFiles")
If rc = 0 Then
Print "Copy has started successfully."
Else
Print "Could not begin copy."
End If
End Sub
|