Command Line Overview

Navigation:  Using FolderSizes > Command Line Support >

Command Line Overview

Previous pageReturn to chapter overviewNext page

FolderSizes supports command-line execution (e.g. from a command prompt) with parameters. Parameters are not case sensitive. These can be used to schedule specific operations, or to call certain functions from a batch file, for example. Note that passing command line parameters into FolderSizes will automatically suppress the display of the splash screen and the welcome wizard (if they are configured to display normally).

 

Note: FolderSizes provides a fully integrated task scheduler that can be used to formulate command line arguments and schedule execution of various reports.

 

Supported Command Line Parameters

 

Path (required)

 
The "path" parameter is required in order for any other command-line parameters are to be evaluated (except for the "drivespace" parameter, described below). An example which would allow you to scan the temp folder on your D drive would look like:

 

Example: foldersizes.exe /path:"d:\temp"

 

Multiple paths can be scanned by separating them with with pipe symbols. Note the use of pipes in the example below:

 

Example: foldersizes.exe /path:"d:\temp|c:\windows|\\server\share"

 

You can also use one or more fully qualified Snapshot file (.fssx) file paths in place of normal file system paths, in which case the Snapshot file itself becomes the data source for the file system analysis. This feature works for folder, file, and search reports.

 

Example: foldersizes.exe /path:"d:temp\snapshot.fssx"

 

Export

 

Exports the generated report(s) to disk once the file system analysis has completed. The export file format will be deduced by the file extension passed in. You must provide a fully qualified path for export files:

 

HTML example: foldersizes.exe /path:"d:\temp" /export:"d:\tmp\myreport.html"

CSV example: foldersizes.exe /path:"c:\windows" /export:"d:\tmp\myreport.csv"

XML example: foldersizes.exe /path:"c:\program files" /export:"d:\tmp\myreport.xml"

 

To export a generated report in multiple formats at once, separate the export paths with a pipe ("|") symbol, like this:
 
HTML & CSV example: foldersizes.exe /path:"d:\" /export:"d:\tmp\myreport.html|d:\tmp\myreport.csv"

 

Snapshot

 

Allows for the creation of file system Snapshots via the command line. When this command line parameter is used, the "path" parameter (described above) represents the source (scan path) and the "export" parameter represents the output path.

 

  Example: foldersizes.exe /snapshot /path:"d:\temp" /export:"d:\temp\snapshot.fssx"

 

The above command will create a snapshot of the "d:\temp" folder and store the resulting snapshot file ("snapshot.fssx") in the same folder.

 

DriveSpace

 

This parameter can be used to export the contents of the FolderSizes drive space docking panel, which contains a configurable (see program options) list of system drives (fixed, remote, removable, etc.) along with space metrics and other information.

 

Example: foldersizes.exe /drivespace:"d:\drivespace.pdf" /exit

 

The export file format will be deduced by the file extension passed in. In the example above, we pass in a ".pdf" file extension, which results in a PDF file format export.

 

This is the only command line parameter that can be used without also specifying a "path" (see above). It can, however, be used in combination with other parameters.

 

LoadOptions

 

Used to load program options prior to executing any remaining command line instructions. You must specify the full path to a program options data file previously saved with FolderSizes.

 

Example: foldersizes.exe /path:"d:\" /export:"d:\report.html" /loadoptions:"c:\temp\myoptions.dat"

 

Graphtype

 

Used for switching between the "bar", "pie", and "map" graph types available for inclusion within reports exported in HTML format (does not apply to other export file formats such as CSV, TXT, or XML). For example, if you wanted to export an HTML report via the command line, but prefer to have a pie graph (versus the default bar graph), you can do something like the following:

 

Example: foldersizes.exe /path:"d:\" /export:"d:\report.html" /graphtype:"pie"

 

Date

 

Causes any output path names (specified by the "/export" command line parameter) to include the current date and time in mm-dd-yy_HHMMSS format. For example, if you pass in an "/export" path of "d:\temp\test.html" and include the "/date" parameter, the output path will be transformed into "d:\temp\test_01-03-04_092322.html" (except the current date and time will be used). Useful when exporting file analysis results to a common folder and wish to keep the file names unique (e.g. so previous files are not overwritten).

 

Example: foldersizes.exe /path:"d:\" /export:"d:\myreport.xml" /date

 

FileReport

 

Triggers generation of one or more of the following types of File Reports. Pass one of the the following keywords to the "filereport" parameter to product the desired report.

 

Use this keyword

To produce this file report

[all]

All file reports (supported formats only*)

largest

Largest files

oldest

Oldest files

newest

Newest files

temporary

Temp files

duplicate

Duplicate files

types

File types

typesgraph

File types graph

typegroups

File type groups

typegroupsgraph

File type groups graph

attribs

File attributes

attribsgraph

File attributes graph

owners

File owners

ownersgraph

File owners graph

sizes

File sizes

sizesgraph

File sizes graph

names

File names

namesgraph

File names graph

dates

File dates

datesgraph

File dates graph

 

Example: foldersizes.exe /path:"d:\temp" /filereport:"largest" /export:"d:\largest_files.html"

 

Note: It is possible to generate and export multiple File Reports at once from the command line. See the Advanced Uses topic of this help chapter for additional details.

 

* When using the "[all]" keyword to export all enabled file reports to a single file, you must specify either an HTML (.html) or MS Excel (.xls) file extension in the "export" command line parameter.

 

Search

 

Causes FolderSizes to initiate a search from an existing search job definition file. Important: when using the "search" command line argument, the purpose of "path" argument (which is always required; see above) changes. For searches, the "path" argument must reference a fully qualified search job file path. You must also include the "search" command line argument, like this:

 

Example: foldersizes.exe /path:"d:\search_job.xml" /search /export:"d:\search_out.html" /exit

 

The example above loads a search job file that already exists in the "d:\search_job.xml" path. You must create the search job file in advance (please see this topic for additional information) in order to execute a search from the command line.

 

It is possible to execute a search and then export the results in multiple formats at once. See the Advanced Uses topic of this help chapter for additional details. Note that search results can be exported in one of three formats: HTML (.html), comma separated values (.csv), and tab delimited text (.txt).

 

Email

 

Sends all command line (or scheduler) file outputs to one or more email addresses (separated by commas). Requires use of the "export" command line option (see above). For details, see the email integration topic.

 

Example: foldersizes.exe /path:"d:\temp" /export:"d:\myreport.html" /email:"user@domain.com" /exit

 

Sort

 

Specified how a detail view report is to be sorted. The sort phrase is a combination of the column header to be sorted, followed by "ASC" (for ascending sort) or "DESC" (for descending sort).

 

Example: foldersizes.exe /path:"d:\temp" /sort:"size DESC" /export:"d:\tmp\myreport.html" /email:"user@domain.com" /exit

 

Important: Sorting is supported in any FolderSizes detail view report (e.g. main window reports, search results, file report list views, etc.). When specifying the sort column, refer to the column header itself and use the full text associated with that column header (including any spaces). For information on sorting multiple file report outputs separately, see the Advanced Uses topic.

 

SubDisplayDepth

 

Sets the subfolder display depth prior to the command line job being executed. Does not apply to File Reports (applies only to normal explorations that appear in the main application window).
 
Example: foldersizes.exe /path:"d:" /subdisplaydepth:"3" /exit

 

ScanFilter

 

Specifies the full path of a scan filter to apply to the current session. Note that passing this command line parameter in enables scan filtering for both normal scans (which are viewed in the main window) and file reports. The scan filter will be applied for the duration of the FolderSizes process lifecycle (e.g. until the window is closed, either via /exit or some other means).

 

Example: foldersizes.exe /path:"d:" /filereport:"largest" /scanfilter:"d:\scan-filter.xml" /exit

 

Note: You need to already have a scan filter defined and saved to a file before you can use the "/scanfilter" command line parameter. To learn more about managing scan filters, see this topic.

 

SaveEventLog

 

Dumps the contents of the active event log to file. Note that if this parameter is combined with the /date switch, the resulting event log will be appended with a date/time stamp as well.
 
Example: foldersizes.exe /path:"d:" /saveeventlog:"d:\temp\eventlog.txt"

 

NoXSLT

 

This option applies to XML exports only, and suppresses the linkage of the FolderSizes XSLT file regardless of whatever export program option is currently specified. This command line parameter takes no arguments.
 
Example: foldersizes.exe /path:"d:\temp" /export:"d:\myreport.xml" /noxslt

 

Exit

 

Causes FolderSizes to exit once all the command line scanning options are completed. This allows for the generation of an HTML report (for example) on a scheduled basis, with FolderSizes automatically terminating in between executions. This command line parameter takes no arguments.

 

Example: foldersizes.exe /path:"d:" /export:"d:\largest_files.html" /exit