A command, in FileSieve automation, is an instruction that tells FileSieve to perform a certain action. All commands return a value denoting whether the command was successful or not.
FileSieve Automation
The available command-line commands in this version of FileSieve are detailed below. Please note that any failed automation commands return a specific exit code on application exit; these will be detailed in a later update of this documentation.
All automation commands and procedures are logged within the Automation
section of the Log window.
- autofile <filename>on failure: aborts automation
Please see the AutoFile section below. This command requires either the Home
or Enterprise Edition
.
- wait <interval>on failure: automation continues
Halts automation for the specified number of milliseconds. 1000 milliseconds equals 1 second. For example, setting interval to 10000 will wait for 10 seconds.
- windowstate <minimise | restore>on failure: automation continues
- minimise, minimize
- restore, normal
- Example: FileSieve.exe -windowstate=minimise
Sets the window state of the main FileSieve window. The available options are as follows.
Minimises the window to the taskbar.
Restores the window to its normal on-screen size; this is used to bring back the window from the taskbar when minimised.
Minimises the main window to the taskbar.
- profile <profile_name | profile_guid>on failure: aborts automation
- Example: FileSieve.exe -profile="Default Profile"
Selects an existing profile either by its name or by its GUID. Use quotes around a name that contains any spaces; see example below.
If the profile wasn't found or couldn't be set, automation aborts.
Activates a profile called Default Profile
.
- clearsourceson failure: automation continues
- Example: FileSieve.exe -clearsources
Clears all items from the currently active Profile's Sources list.
Removes all sources for the currently active Profile.
- sources <path1
`
path2`
path3`...>on failure: aborts automation - Example: FileSieve.exe -sources="Z:\Mypath"
- Example: FileSieve.exe -sources="Z:\Mypath"
`
"D:\Files"
Adds a new source to the currently active Profile.
Multiple sources are delimited with the backtick `
character. Each source path should be surrounded with quotes ". Sources that
already exist within the currently active Profile will be ignored.
Adds a new source item path called Z:\Mypath
to the currently active Profile.
Adds two new source items called Z:\Mypath
and D:\Files
to the currently active Profile.
- destination <path>on failure: aborts automation
- Example: FileSieve.exe -destination="Z:\Mypath"
Sets the destination for the currently active Profile to the specified path. Before the destination is set, the path is checked to ensure that it exists.
Sets the destination for the active profile to Z:\Mypath
.
- copymode <simulate | copy | move | delete>on failure: aborts automation
- Example: FileSieve.exe -copymode=simulate
Sets the copy mode. Please note that the Delete
mode isn't available in the Freeware Edition of FileSieve.
Copymode respects the allowed modes as set in the Profile Manager; trying to set a disallowed mode will fail.
The copy mode for the active profile is set to simulate
.
- start
Starts processing the currently active profile with the currently set options.
If you're setting any options, please ensure you set them before calling start
otherwise they won't affect
the processing.
- close, exit
Entirely exits the FileSieve application. Note: This has been disabled in 4.22 due to a crash during the close.
FileSieve Automation: AutoFile
As well as automation via the command-line, FileSieve supports automation via an external file.
To specify an AutoFile (an Automation File), use the following syntax:
FileSieve.exe /autofile="c:\mypath\myautofile.txt"
The autofile
command can be amongst other commands (in both the command-line and within an
AutoFile
) and will be executed in-turn; an autofile
can call another
autofile, but please note that there is a recursion limit of 50 to prevent any problems.
The syntax is the same for running commands via the command-line, but each command needs to be on its very own line; there can also be
spaces in-between the equals =
character that separates the command and its value. Unlike the command-line, quotes around
values can be omitted, if preferred.
Comments can be placed on a line by placing a hash #
character at the very start of the line itself.
Below is an example of an external Automation file.
# Automation file example. Comments start with a hash. # Wait for half a second before continuing. Wait = 500 # Minimise the main window. WindowState = Minimize # Wait for 2 seconds. Wait = 2000 # Restore the main window. WindowState = Restore # Change the copy mode. CopyMode = Simulation # Call another AutoFile. AutoFile = "C:\Some Folder\Another Automation File.txt" # Below will execute once the above AutoFile has finished. CopyMode = Copy
When calling an AutoFile
from within another AutoFile
, the called AutoFile will have its
commands executed and once the last command is executed, execution will then go back to the calling AutoFile and resume
on the line directly after that AutoFile
line.