In addition to script shortcuts and script events, you can run Accredo scripts from the command line. This is useful for initial processing to occur on startup or for driving Accredo from third party applications.
For example, to run ScriptName.pfs, the syntax used could be:
Accredo.exe [/m] /s ScriptName.pfs OutputFile.txt
Parameter |
Description and Use |
|---|---|
|
Minimises the application so processing is done without visual feedback. This only works for scripts that do not involve form manipulation. It is useful when dealing with data objects to perform imports or exports of data from the system, where no visual feedback is required. |
|
Specifies the name of the script to execute, then closes the application. The script is located relative to the Scripts directory under the system path (AccredoSaturn or AccredoMercury) unless a fully specified path is used. |
|
Specifies the name of the script to execute, leaving the application open. The script is located relative to the scripts directory under the System path (AccredoSaturn or AccredoMercury) unless a fully specified path is used. |
|
(Optional) Script output will be sent to the standard output unless the output file is specified. Command Line Syntax For example:
This will produce output in the file specified. Windows does not support output redirection in Explorer shortcuts so the alternative syntax is used. Explorer Shortcut Syntax For example:
|
|
(Optional) Output will be appended to output.txt rather than overwriting, which is the default. |
|
Sets a forced exit after a specified amount of time. The script will exit after For example, to force exit after ten minutes:
|
/LOCKTIMEOUT |
LockTimeOut sets the number of milliseconds that the application will wait to obtain a lock. This can avoid global deadlocks for records. |
See Command Line and Config File Switches for a full list of switches available.
Script Log location
In the Properties for Windows Shortcuts, there is a Start in: field. The Script Log will be located in the path specified in the Start In: field.
See also Guarded File.
Log in
When a command line script starts to execute, if you are not logged into a Company, you must login to the Company as a User before Accredo objects are created (see Login function). Once logged in, the script will be in the same environment as if you had logged in manually via the User interface. Once script processing is complete, you can use the Logout function (not mandatory).
Sample Command Line Script
const CompanyCode = "DEMO"const UserCode = "ACCREDOUSER"const Password = "USERPASSWORD"If not Login(CompanyCode, UserCode, Password) then Error "Login failed"' play script hereIf not Logout Then Error "Logout failed"