|
To configure the execution of a script after download:
As mentioned above, script execution after download supports passing variable to the script. Therefore the client offers some place holders to specify next to the full path and the script name.
Place holder | Description |
---|---|
$file | Contains the full path and the filename of the downloaded file. Example:
|
$path | Contains the full path to the downloaded file. Example:
|
$folderpath | Contains the root path of the folder which contains the downloaded file. Example:
|
$sources | Contains the name of the source devices for this file (comma-separated). Example:
|
Below you will find some configuration examples for script execution:
To execute C
:\Program Files\Notification\notify.exe
after every successful download:
"C:\Program Files\Notification\notify.exe" |
To execute the batch file received.bat
and pass the filename with full path information to the script:
"C:\Scripts\received.bat" "$file" |
To start the batch file automation.bat
in a separate window and pass the filename with full path information to the script:
cmd /C start "C:\Scripts\automation.bat" "$file" |
To apply the hidden attribute on Windows after the file has been downloaded:
cmd /C attrib +h "$file" |
To execute a file after the file has been downloaded:
cmd /C "$file" |
To upload a file to a different system using cURL and a web form provided on the remote system:
/usr/bin/curl --proxy "" -f -m 20 -s -L -F "file=@$file" -F "AutoUpload=true" http://upload.example.com:8080/upload.html |
To configure script execution on headless clients, search for the folder name in the Client Configuration Files. There will be some entries starting with f.<folder_id>
. Different settings for one folder always start with the same folder ID. Those lines also include a line for the script execution, which has an empty value by default:
f.<folder_id>.dlscript= |
To add a script to be executed after downloaded and optionally a place holder for passing a variable to the script, please see the example below:
f.d7fa8ccabbdca962f39125057be70707.dlscript=c:\\Scripts\\received.bat "$file" |
Please note: On Windows operating systems it's necessary to use double backslahes in path names.
The client logs all successful and failed script executions to the log files, if logging has been enabled. Please check the Client Log Files for error messages if you face any problems.