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.

  • setwindowlocation <x,y>on failure: automation continues
  • Sets the position of the main window to the specified screen pixel location. X is the left (of the window) position and Y is the top (of the window) bottom.

    • Example: FileSieve.exe -setwindowlocation=500,200
    • Sets the left-side of the main window to 500 pixels from the left of the current screen and 200 pixels from the top of the current screen.

  • 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.

  • clearsourceson failure: automation continues
  • Clears all items from the currently active Profile's Sources list.

    • Example: FileSieve.exe -clearsources
    • Removes all sources for the currently active Profile.

  • purgesourceson failure: automation continues
  • Scans the Source Items list and removes any Source Item directories that don't exist on disk.

    Only Source Items that are enabled (have a checkmark) will be checked; unchecked will be ignored for purging. The log window will contain the number of items that were purged, if any.

    • Example: FileSieve.exe -purgesources
    • Purges all sources for the currently active Profile.

  • sources <path1`path2`path3`...>on failure: aborts automation
  • 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.

    • Example: FileSieve.exe -sources="Z:\Mypath"
    • Adds a new source item path called Z:\Mypath to the currently active Profile.

    • Example: FileSieve.exe -sources="Z:\Mypath"`"D:\Files"
    • Adds two new source items called Z:\Mypath and D:\Files to the currently active Profile.

  • loadsources <file1.fss`file2.fss`...>on failure: automation continues
  • Loads source items from a previously-saved source list. A source list contains multiple path locations that should be added to the currently active Profile. Use the Save List toolbar item within the Step 1: Source Items list to save a list that can be used with this command.

    Multiple source files are delimited with the backtick ` character. Each source file should be surrounded with quotes ". Locations that are already present within the currently active Profile will be ignored.

    • Example: FileSieve.exe -loadsources="myfile1.fss"`"myfile2.fss"
    • Adds all item locations from both the myfile1.fss and myfile2.fss source lists.

  • 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.

  • setmethod <name | guid>on failure: aborts automation
  • The the Method that should be used for processing.

    Either the name of the Method or the Method's GUID can be used for specifying the Method to be set. Double-clicking on a Method listed within the Introduction - Installed Plugins area of the main window will display the name and GUID of the respective Method.

    • Example: FileSieve.exe -setmethod=DateStamp
    • Sets the active Method to the DateStamp method. Individual method options cannot yet be set; set the options ahead of time and they'll be used during automation.

  • setmodifiers <name | guid>, name | guid, ...>on failure: aborts automation
  • The the Modifier(s) that should be used for processing.

    Either the name of the Modifier or the Modifier's GUID can be used for specifying the Modifier to be set. Double-clicking on a Modifier listed within the Introduction - Installed Plugins area of the main window will display the name and GUID of the respective Modifier.

    Multiple Modifiers can be set by separating them using the comma , character.

    Calling SetModifiers more than once with different Modifiers will set those Modifiers in addition to any previously-set Modifiers. Use ClearModifiers to remove any existing Modifiers.

    • Example: FileSieve.exe -setmodifiers=Casing,DateStamp
    • Sets the active Modifiers to the Casing and the DateStamp modifiers. Individual modifier options cannot yet be set; set the options ahead of time and they'll be used during automation.

  • clearmodifiers, removemodifierson failure: automation continues
  • Clears all currently set Modifiers.

    • Example: FileSieve.exe -clearmodifiers
    • Disables all Modifiers for the currently active Profile.

  • 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, quit
  • 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.

By default, there is a recursion limit of 50 on the total number of AutoFiles that can call child AutoFiles.