Files & Folders commands
file · folder · zip
file File
File operations.
Actions (--action)
--action:copy
| Parameter | Value | Default | Description |
|---|
--source required | text | | A file on the agent machine. |
--destination required | text | | A file on the agent machine. |
--overwrite | true / false | false | |
--action:move
| Parameter | Value | Default | Description |
|---|
--source required | text | | A file on the agent machine. |
--destination required | text | | A file on the agent machine. |
--overwrite | true / false | false | |
--action:rename
| Parameter | Value | Default | Description |
|---|
--path required | text | | File path A file on the agent machine. |
--newname required | text | | |
--action:delete
| Parameter | Value | Default | Description |
|---|
--path required | text | | File path A file on the agent machine. |
--action:exists
| Parameter | Value | Default | Description |
|---|
--path required | text | | File path A file on the agent machine. |
--output required | variable name | | Variable that receives the result |
--action:getinfo
| Parameter | Value | Default | Description |
|---|
--path required | text | | File path A file on the agent machine. |
--output required | variable name | | Variable that receives the result |
--action:read
| Parameter | Value | Default | Description |
|---|
--path required | text | | File path A file on the agent machine. |
--encoding | text | utf-8 | |
--output required | variable name | | Variable that receives the result |
--action:write
| Parameter | Value | Default | Description |
|---|
--path required | text | | File path (created when missing) A file on the agent machine. |
--content required | any value | | |
--encoding | text | utf-8 | |
--mode | one of overwrite, append | overwrite | |
--action:append
| Parameter | Value | Default | Description |
|---|
--path required | text | | File path (created when missing) A file on the agent machine. |
--content required | any value | | |
--encoding | text | utf-8 | |
--action:wait
| Parameter | Value | Default | Description |
|---|
--path required | text | | File path A file on the agent machine. |
--timeout | number | 60 | Timeout in seconds |
--retry | number | | Number of retry attempts. When not set, screen and file commands try once more after a passing problem (a page still loading, a covered element, a locked file); 0 turns that off |
--retryinterval | number | 1 | Seconds between retries |
Examples
file --action:delete --path:"C:\Temp\export.csv" --onerror:continue --errorto:deleteError
if --condition:"$deleteError$ != null"
log --message:"Could not delete the export: $deleteError.Message$" --level:warning
endif
file --action:copy --source:"C:\a.txt" --destination:"C:\backup\a.txt" --overwrite:true
file --action:move --source:"C:\a.txt" --destination:"D:\archive\a.txt" --overwrite:true
file --action:rename --path:"C:\a.txt" --newname:"b.txt"
file --action:delete --path:"C:\a.txt"
file --action:exists --path:"C:\a.txt" --output:fileExists
file --action:read --path:"C:\data.txt" --encoding:"utf-8" --output:content
file --action:write --path:"C:\output.txt" --content:$result$ --encoding:"utf-8" --mode:overwrite
file --action:append --path:"C:\log.txt" --content:"New line of text"
file --action:getinfo --path:"C:\a.txt" --output:fileInfo
file --action:wait --path:"C:\incoming\report.csv" --timeout:60
folder Folder
Folder operations.
Actions (--action)
--action:create
| Parameter | Value | Default | Description |
|---|
--path required | text | | Folder path A folder on the agent machine. |
--action:empty
| Parameter | Value | Default | Description |
|---|
--path required | text | | Folder path A folder on the agent machine. |
--action:copy
| Parameter | Value | Default | Description |
|---|
--source required | text | | A folder on the agent machine. |
--destination required | text | | A folder on the agent machine. |
--action:move
| Parameter | Value | Default | Description |
|---|
--source required | text | | A folder on the agent machine. |
--destination required | text | | A folder on the agent machine. |
--action:rename
| Parameter | Value | Default | Description |
|---|
--path required | text | | Folder path A folder on the agent machine. |
--newname required | text | | |
--action:delete
| Parameter | Value | Default | Description |
|---|
--path required | text | | Folder path A folder on the agent machine. |
--force | true / false | false | |
--action:exists
| Parameter | Value | Default | Description |
|---|
--path required | text | | Folder path A folder on the agent machine. |
--output required | variable name | | Variable that receives the result |
--action:getinfo
| Parameter | Value | Default | Description |
|---|
--path required | text | | Folder path A folder on the agent machine. |
--output required | variable name | | Variable that receives the result |
--action:listfiles
| Parameter | Value | Default | Description |
|---|
--path required | text | | Folder path A folder on the agent machine. |
--filter | text | *.* | |
--subfolder | true / false | false | Include subfolders |
--output required | variable name | | Variable that receives the result |
--action:listfolders
| Parameter | Value | Default | Description |
|---|
--path required | text | | Folder path A folder on the agent machine. |
--subfolder | true / false | false | Include subfolders |
--output required | variable name | | Variable that receives the result |
Examples
folder --action:create --path:"C:\NewFolder"
folder --action:copy --source:"C:\Source" --destination:"D:\Backup\Source"
folder --action:move --source:"C:\Source" --destination:"D:\Archive\Source"
folder --action:rename --path:"C:\OldName" --newname:"NewName"
folder --action:delete --path:"C:\TempFolder" --force:true
folder --action:exists --path:"C:\Reports" --output:folderExists
folder --action:getinfo --path:"C:\Reports" --output:folderInfo
folder --action:listfiles --path:"C:\Reports" --filter:"*.pdf" --subfolder:false --output:fileList
folder --action:listfolders --path:"C:\Projects" --output:folderList
folder --action:empty --path:"C:\Temp"
zip Zip
Compresses files and folders into a .zip file, extracts one and lists what is in it.
Actions (--action)
--action:compress
Files go into the archive under their name, folders under their name with everything inside them.
| Parameter | Value | Default | Description |
|---|
--source required | any value | | A file, a folder, a list variable or comma-separated paths |
--destination required | text | | Zip file to write (replaced when it exists) A file on the agent machine. |
| Parameter | Value | Default | Description |
|---|
--file required | text | | Zip file A file on the agent machine. |
--destination required | text | | Folder to extract into (created when missing) A folder on the agent machine. |
--overwrite | true / false | true | Replace files that already exist |
--action:list
The paths of the files in the archive, as a list.
| Parameter | Value | Default | Description |
|---|
--file required | text | | Zip file A file on the agent machine. |
--output required | variable name | | Variable that receives the result |
Examples
zip --action:compress --source:"C:\Reports" --destination:"C:\Out\reports.zip"
zip --action:compress --source:$files$ --destination:"C:\Out\files.zip"
zip --action:extract --file:"C:\In\data.zip" --destination:"C:\In\data" --overwrite:true
zip --action:list --file:"C:\In\data.zip" --output:entries