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.

  • 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
  • Sets the window state of the main FileSieve window. The available options are as follows.

    • minimise, minimize
    • Minimises the window to the taskbar.

    • restore, normal
    • Restores the window to its normal on-screen size; this is used to bring back the window from the taskbar when minimised.

      • Example: FileSieve.exe -windowstate=minimise
      • Minimises the main window to the taskbar.

  • profile <profile_name | profile_guid>on failure: aborts automation
  • 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.

    • Example: FileSieve.exe -profile="Default Profile"
    • Activates a profile called Default Profile.

  • destination <path>on failure: aborts automation
  • 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.

    • Example: FileSieve.exe -destination="Z:\Mypath"
    • Sets the destination for the active profile to Z:\Mypath.

  • copymode <simulate | copy | move | delete>on failure: aborts automation
  • 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.

    • Example: FileSieve.exe -copymode=simulate
    • 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.