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

 

Important Note: With the release of FolderSizes 4.6, a fully integrated task scheduler is available and can be used to formulate command line arguments as well as schedule execution of various FolderSizes reports.

 

Supported Command Line Parameters

 

•        A "path" parameter, which must exist if any other command-line operations are to be executed. 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 a pipe symbol. Note the use of pipes in the example below (shown in bold for readability):

 

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

 

•        An "export" parameter, which will export the generated report to disk once the file system scan has completed. Note that file format of the export will be deduced by the file extension passed in. You must provide a complete path for the export file, like this:

 

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"

 

•        A "graphtype" parameter, 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"

 

•        A "date" parameter that will force 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" (only using the current date and time, of course). This can be useful when you need to schedule report generations and need to output them into a common folder (the date will help ensure their uniqueness).

 

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

 

•        A "filereport" parameter, which tells FolderSizes to immediately launch a specific type of file report and display it on-screen. The "filereport" flag must be followed by one of the types listed below.

 

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

 

"largest" - largest files in the scanned folder
"oldest" - oldest files in the scanned folder
"temporary" - temp files in the scanned folder
"duplicate" - duplicate files in the scanned folder
"types"        - file types in the scanned folder
"typesgraph" - file types (graph view) in the scanned folder
"attribs" - distribution of files by file attributes
"attribsgraph" - graph view of file distribution by attributes
"owners" - distribution of files by owner
"ownersgraph" - graph view of file distribution by owner
"sizes" - distribution of files by size
"sizesgraph" - graph view of file distribution by size
"names" - distribution of files by filename length
"namesgraph" - graph view of file distribution by filename length
"dates" - distribution of files by date
"datesgraph" - graph view of file distribution by date

 

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.

 

•        A "search" parameter, which 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).

 

•        A "subdisplaydepth" parameter, which 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

 

•        A "noshowreport" parameter, which will suppress the showing of HTML report exports in the default web browser (even if this option is enabled within the options window).

 

•        A "scanfilter" parameter, which receives 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.

 

A "saveeventlog" parameter, which will dump 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"

 

•        There is also an "exit" parameter, which will cause 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.