Advanced Uses

Top  Previous  Next

There are several advanced uses of FolderSizes command line support that we will outline here.

 

File Report Export Combinations

 

To execute a File Report from the FolderSizes command line, you use the /filereport parameter is used to specify the type of File Report (e.g. "largest files", "oldest files", etc.) that is desired.

 

However, what if you wanted to generate more than one type of File Report at the same time, and then export each of them... all with a single command? This is absolutely possible to do, but you must follow the command line syntax carefully. The trick is to use a pipe symbol (e.g. "|") to delimit the arguments associated with the /filereport and (optionally) the /export command line parameters.

 

This concept is easier to grasp once you see it in action. Here's an example that uses the FolderSizes command line to generate both "largest files" and "oldest files" reports, which are both then exported to different file locations (in different file formats) within the c:\temp\ folder on the local hard drive. Note how the arguments passed to /filereport and /export are delimited by pipe symbols.

 

foldersizes.exe /path:"c:\windows" /filereport:"largest|oldest" /export:"c:\temp\largest.html|c:\temp\oldest.csv" /noshowreport /exit

 

As you can probably determine by studying the example above, the order of arguments passed into /filereport must correlate to those passed into /export. The result of the execution of the command above is that the "largest files" report is created and exported to c:\temp\largest.html (in HTML format), and the "oldest files" report is created and exported to c:\temp\oldest.csv (in CSV format). In both of these cases, FolderSizes automatically deduces the export file type based upon the export path file extension you provide.

 

See also: Multiple File Report Paths.

 

Ancillary Parameters

 

The example above also uses the /noshowreport command line parameter to suppress the display of the resulting reports in a web browser instance on-screen. You can achieve a similar affect by disabling the "show report" option entirely within the export section of the FolderSizes options window, but the /noshowreport parameter is more granular.

 

Finally, the sample above uses the /exit command line parameter to close FolderSizes once the report generation and export processes are complete. Note that if the execution of the command line job results in an on-screen error within FolderSizes, the /exit parameter will not be properly honored. For this reason, we recommend always testing your use of command line parameters carefully before using them for production purposes.

 

Important: Before attempting to export any File Report to disk, make sure you know which export file formats are supported by that specific report. For example, the hierarchical nature of the Duplicate Files report limits it's supported export file format to HTML (and not CSV or TXT). If you attempt to generate and export any File Report to an unsupported file format, an on-screen error will be displayed.

 

Two More Examples

 

Here's an example of a fairly complex command line process that generates four different File Reports (including a graph report) directly to disk in a single pass.

 

foldersizes.exe /path:"d:\" /filereport:"largest|oldest|temporary|datesgraph" /export:"c:\temp\largest.html|c:\temp\oldest.csv|c:\temp\tempfiles.html|c:\temp\datesgraph.jpg" /noshowreport /exit

 

And one more that demonstrates the execution of a single FolderSizes search job, which is then exported in multiple formats:

 

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

 

As you can see in both of the examples above, the "export" command line argument is capable of accepting multiple paths, delimited by a pipe ("|") symbol. The output format of the export file is deduced from the file extension you provide.