4.1.0
Displayed configured parameters in the drop-down list of Script Parameter.
FineDataLink provides the Bat Script node, which allows you to invoke BAT scripts on a remote Windows server, as shown in the following figure.
1. The following four characters cannot be contained in the storage path and parameter values of BAT scripts: ampersands (&), vertical bars (|), less-than signs (<), and greater-than signs (>).
2. The BAT scripts do not support the PAUSE command.
3. If a parameter value contains spaces, you need to enclose the value in quotation marks ("").
4. Since FineDataLink depends on the SSH data connection to invoke BAT scripts on a remote server, the BAT scripts to be invoked must be stored in a Windows environment where SSH functionality is supported, as shown in the following table.
Desktop Edition
Windows 1.0, Windows 2.0, Windows 3.0, Windows 3.1, Windows 7, Windows 8, Windows 8.1, Windows 95, Windows 98, Windows 10, Windows 11, Windows Me, Windows XP, and Windows Vista
OpenSSH needs to be manually installed in the Windows environments to invoke BAT scripts in these environments.
Windows 10 build 1809 and later versions
With built-in OpenSSH, the Windows environments support BAT script invocation by default.
Server Edition
Windows NT 3.1, Windows NT 3.5, Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows Server 2003, Windows Server 2008, Windows Server 2012 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, and Windows Server 2019
Windows Server 2019 and later versions
You can download and extract the ZIP file to obtain the demo script: bat script.zip
The Grade.bat script contains the grades of students. It can accept student names (which are values of the name parameter), retrieve grades corresponding to students, and then output the data to the test.txt file.
The test.txt file is created automatically after the execution of the Grade.bat script in the same directory as the BAT script.
Before executing BAT scripts in the Bat Script node, you need to configure the SSH data connection first to connect to the remote target server, as shown in the following figure.
1. Fetch the student name, as shown in the following figure.
2. Output the fetched data as a parameter.
Set the parameter name to name as the demo BAT script accepts name, and fetch data from all rows in the first column. The debug value is set only for data preview at downstream nodes and will not be used during actual execution. You can copy the value from Parameter Preview on the right, as shown in the following figure.
Drag in the Bat Script node, configure the BAT script to be executed, and add the script parameter set in the "Fetching the Student Name and Outputting It as a Parameter" section, as shown in the following figure.
The following table describes the setting items.
SSH Connection
You can select an SSH connection from the drop-down list.
Script Path
You can enter the complete path of the BAT script to be executed on the target server of the SSH connection in Script Path, where:
Only script files with the .bat extension can be executed.
Referencing parameters is supported.
The script path must be secure against shell injection.
Script Parameter
1. You can define parameters to be passed to the script in Script Parameter, where:
You can select existing parameters only. Selecting parameters with the same name is not allowed.
The script parameter must be secure against shell injection.
All script parameters must be configured.
Parameters are passed to the script in a top-to-bottom order.
2. FineDataLink of V4.1.0 and later versions displays configured parameters in the drop-down list, which are divided into Built-in Parameter and Global Parameter.
Parameters with the same name are also included, among which the effective ones are arranged in the following descending priority: parameters set in the Parameter Assignment nodes, parameters of the parent task set in the Invocation Task node, custom parameters, global parameters, and built-in parameters.
Unavailable parameters are grayed out.
Command Timeout Configuration
You can set the maximum allowed time from the start to the completion of script execution. The value defaults to Unlimited.
The command will be terminated if the execution exceeds X second(s), where X ranges from 0 to 1,000,000.
Character Encoding
You can specify the character encoding of the output. The value defaults to UTF-8.
Options in the drop-down list:
UTF-8
GBK
BIG5
ISO-8859-1
1. Click Run to save and run the task. The running result in Log upon successful execution is shown in the following figure.
2. Open the test.txt file automatically created in the same directory as the BAT script and view the content of the file, as shown in the following figure.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy