FolderSizes supports command-line execution (e.g. from a command prompt) with parameters. 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).
Command line parameters are not case sensitive.
Note: FolderSizes provides a fully integrated task scheduler that can be used to formulate command line arguments and schedule execution of most report types.
Supported Command Line Parameters
The "path" parameter is required in order for any other command-line parameters are to be evaluated (except for the "drivespace" parameter, described below). It represents the path that will be scanned (e.g. the target of your analysis). 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"
Another means of passing multiple paths into FolderSizes is via a text (.txt) file. To do so, create and save a text file with one path per line, then pass the path to this text file into the FolderSizes "search" parameter. Doing so will cause FolderSizes to read and analyze the paths this text file contains.
Example: foldersizes.exe /path:"d:\temp\paths.txt"
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"
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"
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.
Additional Snapshot related command line parameters are described here.
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.
Allows users to trigger the creation (and optional export) of a report via the Disk Reporter. You must first create a report within the Disk Reporter and use the Save toolbar function to save the drive listing to the file system. You then pass the resulting text file via the command line as per the example below.
Example: foldersizes.exe /diskreport: /path:"d:\diskdrives.txt" /export:"d:\diskreport.html" /exit
The above command causes FolderSizes to launch the Disk Reporter tool, load a set of drives from the "d:\diskdrives.txt" file (which had been created previously from within the Disk Reporter), and then export the resulting report as HTML.
Can be used to save the contents of the main window scan data folder tree as HTML. This command line argument is executed after scan of the current path (see parameter above) is completed.
Example: foldersizes.exe /path:"d:\temp" /scandatatree:"d:\scandatatree.html" /exit
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"
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"
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
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 file reports (supported formats only*)
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.
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).
When using the "/search" command line option (described) above, this parameter allows you to override the search paths associated with the search job file. In other words, the search paths that are saved along with the job will be ignored in favor of those passed in via this parameter.
Example: foldersizes.exe /path:"d:\search_job.xml" /search /searchpath:"c:\temp" /export:"d:\search_out.html" /exit
Multiple search job paths can be separated with pipe symbols.
This option applies only to searches initiated via the command line that send search results via email (see email command line argument below). When specified, it will suppress email transmission if no search results were found.
Note that search export files will still be generated and retained even if no email is sent.
Example: foldersizes.exe /path:"d:\search_job.xml" /search /searchpath:"c:\temp" /export:"d:\search_out.html" /email:"firstname.lastname@example.org" /noEmptyEmail /exit
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:"email@example.com" /exit
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:"firstname.lastname@example.org" /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.
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
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.
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"
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
This option causes file-level data to be tracked in memory during the file system analysis process. Optionally overrides the default value set in Advanced options.
Example: foldersizes.exe /path:"d:\temp" /export:"d:\myreport.xml" /trackchildfiles:"true"
When exporting data from a detail report view, you can use this parameter to indicate which columns you want exported.
Example: foldersizes.exe /path:"d:\temp" /export:"d:\Report.csv" /viscols:"Name,Size,Allocated,Files" /date /exit
Causes FolderSizes to set the specified path as the current view root. This is mainly useful in cases where you're generating a report from a snapshot (.fssx) file via the scheduler or command line interface. When exporting to "flat" file formats such as HTML, PDF, or Excel, setting the view root allows you to target a specific subfolder.
Example: foldersizes.exe /path:"d\c-drive-snapshot.fssx:" /export:"d:\largest_files.html" /viewroot:"c:\windows" /exit
Causes FolderSizes to launch in a minimized state. IMPORTANT: Can ONLY be used in combination with /exit command line parameter.
Example: foldersizes.exe /path:"d:" /export:"d:\largest_files.html" /minimized /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