EXEC Run an external program or command
- command: external program or command including any parameters.
Some external commands require parameters to be enclosed in double quotes. If you merely fill in the double quotes ScriptFTP will display a syntax error, for example:
In order to resolve this problem you will have to use ‘ instead of “. For example:
This command will return the called program’s exit code.
# Delete all doc files in the current local dir EXEC("del *.doc") # Call an external batch file EXEC("mybatch.bat") $result=EXEC("del *.mf") IF($result!=0) IF($result==1) print("No *.mf files found. Errorcode: ".$result) ELSE print("Del failed. Errorcode: ".$result) exit(1969) END IF ELSE print("deleting files was successful") END IF