Command line options

The Professional Edition of TreeSize accepts command line options enabling you to run scheduled scans or to have the results of a scan on your monitor the next morning.

The dialog for Scheduling scans will help you compile a command line with the options below.

Note

These option are only available in the TreeSize Professional Edition.

All options

Treesize.exe [/OPTION] SCANPATH

/? or /HELP

Shows this help page.

/AGEOFFILES

Saves the graph on the “Age of Files” tab of the scanned directory to a bitmap, GIF, PNG, JPEG, Text, or CSV file. The file type depends on the extension of the specified file name. The following example creates a JPEG image file of the”Age of Files” graph for your local drive C:

Treesize /SCAN "C:\" /AGEOFFILES "C:\Documents\c_file_ages.jpg"

/APPENDTOFILES <value>

With this option, you can select whether or not TreeSize should append its output to existing files when doing an export, e.g. when using /TEXT. Select “True” to append and “False”, if you want to overwrite existing files.

Note

This parameter will not work with exported images, XML and PDF files. Those files always will be overwritten. You can use the switch /DATE to ensure that all generated reports will have a unique file name.

When exporting to an Excel file via /EXCEL, this parameter can be used together with /SHEETNAME to append the data to the specified sheet. Example:

Treesize.exe /SCAN "C:\" /APPENDTOFILES True /EXCEL "C:\Export.xlsx" /SHEETNAME "test"

Treesize.exe /SCAN "C:\" /APPENDTOFILES False /TEXT "C:\Export.csv"

/ARCHIVEBITFILESONLY

This option will include only files for which the archive bit set in the scans. This option can be very useful if you want to calculate the size of a backup. In this case, you can create a shortcut on your desktop or in your start menu that will automatically start calculating the size of your backup. Example:

Treesize /ARCHIVEBITFILESONLY /SCAN "\\Server\Backup\This"

/ATTACH

If specified, all exported files will be attached to the email. If not specified, files with an explicitly given path are not attached. This is useful in case you XML or Excel files are getting quite large and fill up you email account.

This example will export to an Excel file but not attach it to the mail:

TreeSize.exe /SCAN "F:\" /EMAIL "treesize@example.com" /EXCEL "C:\Temp\test.xlsx"

These examples will attach the Excel file to the email:

TreeSize.exe /SCAN "F:\" /EMAIL "treesize@example.com" /EXCEL

TreeSize.exe /SCAN "F:\" /EMAIL "treesize@example.com" /ATTACH /EXCEL "C:\Temp\test.xlsx"

/BARCHART <filename>

Saves the bar chart of the scanned directory to a bitmap, GIF, PNG, or JPEG file. The file type depends on the extension of the specified file name. This example creates a PNG image file of the bar chart for your local drive C:

Treesize /SCAN "C:\" /BARCHART "C:\Documents\c.png"

/COMPARE <filename|path>

Compares the scanned path with a saved index file. The following example scans drive C: and compares the result with a saved XML report for this drive:

Treesize /COMPARE "C:\Reports\TreeSize\c.xml.zip" /SCAN "C:\"

Instead of an index file, you can also use a path with this command line parameter. The given path will be compared with the current scan result. The following example scans drive C:\ and additionally uses the path D:Backup_of_C to perform a comparison between the two:

Treesize /SCAN "C:\" /COMPARE "D:\Backup_of_C"

Alternatively, you can compare two already existing index files e.g. “c1.xml.zip” and “c2.xml.zip” by using this command :

Treesize /OPEN "C:\Reports\TreeSize\c1.xml.zip" /COMPARE "C:\Reports\TreeSize\c2.xml.zip"

The /OPEN command prepares the comparison of the two files by expanding the first file (“c1.xml.zip”) into a scan file. The second file (“c2.xml.zip”) will be compared to this expanded scan file, just like it would happen, if “c2.xml.zip” was compared to a “real” scan.

/COPY <path>

This option can only be used in combination with the command line option /SEARCH.

Copies the results of a TreeSize file search to the target location.

The following command will search on your local drive C: using the latest search options and copies the search results to the folder “C:\temp\ObsoleteFiles”:

Treesize /SEARCH:Start /SCAN "C:\" /COPY "C:\temp\ObsoleteFiles"

See also: Move checked files

/CREATEDPASTDAYSONLY <n>

This option will include only files in the scans, which were created during the number of days entered in the argument. In the following example, this option will only include only files created during the last eight days in the scan:

Treesize /CREATEDPASTDAYSONLY 8

/CREATESNAPSHOT <drive>

Creates a snapshot for the drives that are given after this command line parameter. Example:

Treesize /CREATESNAPSHOT "C:\" "D:\"

Creating snapshots may require administrative privileges.

/CSV <filename>

Saves the results to a CSV file after the scan or search is finished. The application will terminate itself after saving. This example will save the results of a File Search on your local drive C: with the last search configurations to a CSV file:

Treesize /SEARCH:Start /SCAN  "C:\" /CSV "C:\Results\C_search.csv"

/DATE

This switch will add the current date and time to all export file names in the command line. This is useful if you want to do scans regularly, e.g. every night or every weekend. The following example will scan the network path “\\Host\Share” and save the result to a file like “C:\Scans\name_2013-08-14_17-18-24.xls”:

Treesize /SCAN "\\Host\Share" /DATE /EXCEL "C:\Scans\name.xls"

/DEDUPLICATE

This option can only be used in combination with the command line option /SEARCH.

It will replace the duplicate files that were found by the TreeSize duplicate file search with NTFS hardlinks:

Treesize /SEARCH:Start /SCAN "C:\" /DEDUPLICATE

/DELETE

This option can only be used in combination with the command line option /SEARCH.

Permanently deletes all files that have been found as result of a TreeSize file search. Example:

Treesize /SEARCH:Start /SCAN "C:\temp" /FILTER "*.tmp" /DELETE

See also: Move checked files

/EMAIL <recipient>

Sends the collected data to the given email address. This parameter can be used only once on the command line, and only one email with all results will be sent. Multiple recipients can be separated with semicolons (;) or commas. To send emails via the command line, you need to specify valid SMTP settings on the corresponding page in the TreeSize options dialog. Example:

Treesize /SCAN "\\Server\Share" /EMAIL "treesize@example.com"

If no other parameters have been specified, the email will be sent in the format that is set in the options (HTML or plain text). If you would like to define the format independent from the current options, you can use the parameters /TEXT or /HTML right behind the definition of the recipient address(es). Example:

Treesize /SCAN "\\Server\Share" /EMAIL "treesize@example.com" /TEXT

By combining parameters you can also add attachments to the email. The following example will add an Excel report of the scan as an attachment to the email:

Treesize /SCAN "\\Server\Share" /EMAIL "treesize@example.com" /EXCEL

/EMAILIFRESULTSFOUND

This option can only be used in combination with the command line options /SEARCH and /EMAIL. If this parameter is specified, TreeSize will only send an email with the current search results, if at least one file or folder has been found during the search, by any of the specified search types.

/EMPTYRECYCLEBIN

If you use this option, TreeSize will empty the recycle bin before running the current scan. Example:

Treesize /EMPTYRECYCLEBIN /SCAN "C:\"

/EXECUTE

This option can only be used in combination with the command line option /SEARCH.

This parameter allows passing files that have been found by the TreeSize file search to another application or script. A possible target for this parameter can be a batch, or a powershell script. The following example will search drive C:\ with the most recent search settings and call the script “Archive.bat” for each file that has been found. The file will be passed to the script as command line parameter:

Treesize /SEARCH:Start /SCAN "C:\" /EXECUTE "C:\Scripts\Archive.bat"

See also: Move checked files

/EXCEL <filepath>

Exports the collected data in Microsoft Excel format and saves it under the entered file path. If only a file name is specified, the current installation directory is used to store the export. Supported formats are the conventional .XLS file format (Excel 97-2003) as well as the .XLSX format (introduced with Excel 2007). The used format depends on the extension of the specified file name. The application will terminate itself after saving. Example:

Treesize /SCAN "C:\" /EXCEL "C:\Documents\c.xls"

If the file name already exists, the file will be opened and a new worksheet will be added.

Note

In the TreeSize File Search (/SEARCH) the results of each search type are collected in their own specific worksheet. If the file under the given path already exists, these sheets will be overwritten. To prevent this, you need to use the command line option /APPENDTOFILES.

/EXCLUDE <pattern1;pattern2>

This option enables you to specify patterns for files and folders that should be excluded from a scan. Multiple exclude patterns can be separated using a semicolon (;). If one or more of the patterns contain spaces, the complete pattern string must be set into quotes (“). The following example will ignore files and folders that end with “.tmp” or where the exact name is “system”:

Treesize /SCAN "\\Server\Users" /EXCLUDE "*.tmp;system"

/EXPAND <level|size>

This option lets you specify how many levels in the directory tree will be expanded after scanning. If you don’t specify a number after this option, all folders will be expanded. Instead of a directory level you can also indicate an amount in Mega Byte (MB). In this case all folders larger than the given amount will be expanded. The unit “MB” must follow the number without a blank. The following example will scan the folder “H:\User”, expand all folders larger than 10 MB and save the result to the Excel file “C:\Results\Allusers.xlsx”:

Treesize /SCAN "H:\User" /EXCEL "C:\Results\Allusers.xlsx" /EXPAND 10MB

/EXPANDABLEREPORT <value>

If this option is used, Excel exports will use expandable/collapsible groups that can be navigated similar to the directory tree.

Treesize /SCAN "H:\User" /EXPANDABLEREPORT True /EXCEL "C:\Results\Allusers.xlsx"

Treesize /SCAN "H:\User" /EXPANDABLEREPORT False /EXCEL "C:\Results\Allusers.xlsx"

/EXPORTDRIVESLIST <filename>

This option enables you to export the contents of the “Drive List” to an Excel, Text, or CSV file. The file type depends on the extension of the specified file name. Example:

Treesize /SCAN "C:\Results\AllDrives.csv" /EXPORTDRIVESLIST

/EXPORTFILES

If specified, files will be included in all exports. So this option is equivalent to activating the option “Tools > Options > Export > * > Exported elements > Folders and single files”

/EXPORTGROUPSEXPANDED

If specified, the export of the extensions list will contain all information about the extensions contained within groups.

/EXPORTPATHSLIST <filename>

This option can only be used in combination with the command line option /SEARCH.

Exports a simple list that contains all search results. The list will contain only the full paths of the search results and no other information. Supported formats for the destination file are .txt and .csv.

This example will search for, and create a list of all exe files on drive C:

Treesize /SEARCH:Start /SCAN "C:\" /FILTER "*.exe" /EXPORTPATHSLIST "C:\Results\SearchResults.csv"

It can be used to import results of a previous search back into the user interface, by using “File > List of paths > Import path list”, or the parameter /IMPORT.

If the option “Tools > Options > Export > Include duplicate groups” is activated, you can also use this function to export and import results of the duplicate search including their group structure.

/EXPORTTITLE <a class="headerlink" href="#exporttitle-title" title="Link to this heading">¶</a></h3> <p>Can be used to change the title within a printed report or exported file. This allows you to supply additional information to the user when using TreeSize in an automated environment. The use of environment variables is allowed as well. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server3\C$"</span> <span class="o">/</span><span class="n">EXPORTTITLE</span> <span class="s2">"This is drive C on Server3"</span> <span class="o">/</span><span class="n">PRINT</span> </pre></div> </div> </section> <section id="extensionslist-filename"> <h3>/EXTENSIONSLIST <filename><a class="headerlink" href="#extensionslist-filename" title="Link to this heading">¶</a></h3> <p>This option enables you to save the statistics on file extensions / file types of the scanned file system branch to an Excel, HTML, Text, or CSV file. The file type depends on the extension of the specified file name. The exported columns will be those that were enabled in the user interface on the tab “Extensions” when it was last used, or at the time when the configuration file supplied via /OPTIONS was written.</p> <p>The following example scans drive C: and creates an Excel file named “D:\TreeSize Reports\C_filetypes.xls” with the statistics of the file types on this drive:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /EXTENSIONSLIST "</span><span class="n">D</span><span class="p">:</span>\<span class="n">TreeSize</span> <span class="n">Reports</span>\<span class="n">C_filetypes</span><span class="o">.</span><span class="n">xls</span><span class="s2">"</span> </pre></div> </div> </section> <section id="extensionschart-filename"> <h3>/EXTENSIONSCHART <filename><a class="headerlink" href="#extensionschart-filename" title="Link to this heading">¶</a></h3> <p>Saves the small graph shown on the bottom of the “Extensions” page to an image file (bitmap, GIF, PNG, or JPEG).</p> </section> <section id="extensionspiechart-filename"> <h3>/EXTENSIONSPIECHART <filename><a class="headerlink" href="#extensionspiechart-filename" title="Link to this heading">¶</a></h3> <p>Saves a piechart that shows the distribution of “file extensions” to an image file (bitmap, GIF, PNG, or JPEG).</p> </section> <section id="filter-pattern1-pattern2"> <h3>/FILTER <pattern1;pattern2><a class="headerlink" href="#filter-pattern1-pattern2" title="Link to this heading">¶</a></h3> <p>Sets a file filter counting only files with certain extensions, e.g. “.mp3” or “.doc”. Multiple patterns may be passed, separated by semicolon (;). The following example will search for MP3 and AVI files in the “Users” directory on the server:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server\Users"</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"C:\Results\UsersMediaFiles.xlsx"</span> <span class="o">/</span><span class="n">FILTER</span> <span class="s2">"*.mp3;*.avi"</span> </pre></div> </div> <p>When performing a TreeSize File Search (/SEARCH), you can also use the /FILTER command line switch to specify the patterns of the advanced file search. To perform a more complex custom file search you should save the search options to a file and pass the resulting XML file to the command line after /SEARCH.</p> </section> <section id="followreparsepoints"> <h3>/FOLLOWREPARSEPOINTS<a class="headerlink" href="#followreparsepoints" title="Link to this heading">¶</a></h3> <p>If this switch is added to the command line, TreeSize will follow mount points and external symbolic links when scanning a file system tree.</p> </section> <section id="groupscans"> <h3>/GROUPSCANS<a class="headerlink" href="#groupscans" title="Link to this heading">¶</a></h3> <p>Using this command line switch will group all scanned directories under a virtual root folder. Use /GROUPSCANS FALSE if you want to ensure that no virtual root folder is used.</p> </section> <section id="hidesmallfolders-value"> <h3>/HIDESMALLFOLDERS <value><a class="headerlink" href="#hidesmallfolders-value" title="Link to this heading">¶</a></h3> <p>Allows to hide objects that are smaller than a minimum size, which is useful for getting clear exports. <value> can be a size value with unit, or a plain byte value without unit. Cannot be used in combination wih /EXPAND. In this example only folders having a minimum size of 50MB will be exported:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">TreeSize</span> <span class="o">/</span><span class="n">HIDESMALLFOLDERS</span> <span class="mi">50</span><span class="n">MB</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"C:\Results\DriveC.xlsx"</span> <span class="o">/</span><span class="n">SCAN</span> <span class="n">C</span><span class="p">:</span>\ </pre></div> </div> </section> <section id="historychart-filename"> <h3>/HISTORYCHART <filename><a class="headerlink" href="#historychart-filename" title="Link to this heading">¶</a></h3> <p>Saves the graph on the “History” tab of the scanned directory to a bitmap, GIF, PNG, or JPEG file. The file type depends on the extension of the specified file name. This example creates a JPEG image of the history graph for drive C:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /HISTORYCHART "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Documents</span>\<span class="n">c_history</span><span class="o">.</span><span class="n">jpg</span><span class="s2">"</span> </pre></div> </div> </section> <section id="html-filename"> <h3>/HTML <filename><a class="headerlink" href="#html-filename" title="Link to this heading">¶</a></h3> <p>Saves the collected data to a HTML file which can be viewed with any HTML browser. You can specify which information of the scan will be included in the export via “Home > Options > Export > HTML > Charts and lists to include. You can select which of the additional lists, or charts should be added to the export. They will automatically be embedded into the HTML file that is generated after the scan.</p> <p>The following example will generate an HTML report for the drive C: and save it to “D:\HTML”:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /HTML "</span><span class="n">D</span><span class="p">:</span>\<span class="n">HTML</span>\<span class="n">treesize</span><span class="o">.</span><span class="n">html</span><span class="s2">"</span> </pre></div> </div> <p>If you want more than one scan to be part of the HTML file, you should add the command line switch /GROUPSCANS. When exporting to HTML without an included image, you could alternatively us the switch /APPENDTOFILES.Without one of these flags, the HTML file will get overwritten.</p> </section> <section id="import-filename"> <h3>/IMPORT <filename><a class="headerlink" href="#import-filename" title="Link to this heading">¶</a></h3> <p>This option can only be used in combination with the command line option /SEARCH.</p> <p>Loads a list of paths into the user interface of the TreeSize file search. The file can be in .txt, or .csv format. This parameter can be used to import results of a previous search. The imported files and folders can be moved/copied/deleted/archived, like any “live” search result, using the file operation dialog.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SEARCH</span> <span class="o">/</span><span class="n">IMPORT</span> <span class="s2">"C:\Results</span><span class="se">\f</span><span class="s2">ilelist.txt"</span> </pre></div> </div> <p>You can also combine this parameter with the parameters /RECYCLE, /DELETE, or /MOVE to automatically delete or move the files that are contained in the text file. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SEARCH</span> <span class="o">/</span><span class="n">IMPORT</span> <span class="s2">"C:\Results</span><span class="se">\f</span><span class="s2">ilesToDelete.csv"</span> <span class="o">/</span><span class="n">RECYCLE</span> </pre></div> </div> </section> <section id="importpatterns-filename"> <h3>/IMPORTPATTERNS <filename><a class="headerlink" href="#importpatterns-filename" title="Link to this heading">¶</a></h3> <p>Imports a list of patterns from a file. The file can be a simple text file with a ist of filter patterns, separated by semicolon, or you can use the user interface to create a more complex set of patterns and use the export function to generate the pattern file in the XML format. Supported formats are CSV, TXT, and XML.</p> <p>The imported patterns will be used as filters for the scan to either include, or exclude specific files and folders.</p> <p>If used in combination with the command line option /SEARCH, this parameter will create a new advanced search that uses the patterns from the imported file as criteria for the search.</p> <p>This example will import filter patterns that are defined under “C:\TreeSizeFiles\patterns.txt”, start a scan for drive C:\ and export the results to an HTML file:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">IMPORTPATTERNS</span> <span class="s2">"C:\TreeSizeFiles\patterns.txt"</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /HTML "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">scanC</span><span class="o">.</span><span class="n">html</span><span class="s2">"</span> </pre></div> </div> </section> <section id="indexfile-filename"> <h3>/INDEXFILE <filename><a class="headerlink" href="#indexfile-filename" title="Link to this heading">¶</a></h3> <p>Saves the scan results to a SQLite file that can be loaded for comparisons at a later date. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"H:\users</span><span class="se">\"</span><span class="s2"> /INDEXFILE "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">Allusers</span><span class="o">.</span><span class="n">sqlite</span><span class="s2">"</span> </pre></div> </div> </section> <section id="listseparator-separator-char"> <h3>/LISTSEPARATOR <separator char><a class="headerlink" href="#listseparator-separator-char" title="Link to this heading">¶</a></h3> <p>Enables you to define the separator used when exporting text or CSV files. Text files use the tabulator by default, CSV-files the list separator from the regional settings of the Windows control panel.</p> <p>Please specify a single character or the string “TAB” for tabulator after this switch. Examples:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /LISTSEPARATOR ; /TEXT "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">c</span><span class="o">.</span><span class="n">txt</span><span class="s2">"</span> <span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /LISTSEPARATOR TAB /TEXT "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">c</span><span class="o">.</span><span class="n">csv</span><span class="s2">"</span> </pre></div> </div> </section> <section id="move-path"> <h3>/MOVE <path><a class="headerlink" href="#move-path" title="Link to this heading">¶</a></h3> <p>This option can only be used in combination with the command line option /SEARCH.</p> <p>It moves the results of a TreeSize file search to another location.</p> <p>The following command will search on your local drive C: using the latest search options and moves the search results to the folder “C:\Temp\ObsoleteFiles”:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /SEARCH:Start /MOVE "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Temp</span>\<span class="n">ObsoleteFiles</span><span class="s2">"</span> </pre></div> </div> <p>See also: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">Move checked files</span></a></p> </section> <section id="nogui"> <h3>/NOGUI<a class="headerlink" href="#nogui" title="Link to this heading">¶</a></h3> <p>No window will be shown and the application will not appear in the task bar. Useful to execute scans or searches in background, without visual feedback.</p> <div class="admonition warning"> <p class="admonition-title">Warning</p> <p>Use this switch only if you have tested the rest of the command line options because error messages cannot be displayed in this mode.</p> </div> <p>However, errors will be logged in the Windows event log.</p> </section> <section id="noheaders"> <h3>/NOHEADERS<a class="headerlink" href="#noheaders" title="Link to this heading">¶</a></h3> <p>Omits the header lines usually written on top of scan or search export files. This makes it easier to receive plain data for postprocessing.</p> </section> <section id="nounits"> <h3>/NOUNITS<a class="headerlink" href="#nounits" title="Link to this heading">¶</a></h3> <p>Omits the units usually written after size values. This option in combination with /SIZEUNIT 0 will export plain byte values. This makes it easier to receive plain data for postprocessing.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>This command line will only effect exports of the directory tree, generated by using the /TEXT, /EXCEL, /HTML, /EMAIL, or /PRINT options. /EXTENSIONSLIST, /USERSLIST, /EXPORTDRIVESLIST, or /TOPFILESLIST will not be effected.</p> </div> </section> <section id="open-filename"> <h3>/OPEN <filename><a class="headerlink" href="#open-filename" title="Link to this heading">¶</a></h3> <p>Opens a saved XML report on application start. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">OPEN</span> <span class="s2">"C:\Reports\Drive_C.xml.zip"</span> </pre></div> </div> </section> <section id="options-filename"> <h3>/OPTIONS <filename><a class="headerlink" href="#options-filename" title="Link to this heading">¶</a></h3> <p>Use this parameter to apply exported user settings to TreeSize. User settings can be exported at “File > Options > Export”. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">OPTIONS</span> <span class="s2">"C:\Temp\User Settings.xml"</span> </pre></div> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>Change as many settings a possible in the user interface before saving the options to reduce the amount of command line parameters you need.</p> </div> </section> <section id="pdf"> <h3>/PDF<a class="headerlink" href="#pdf" title="Link to this heading">¶</a></h3> <p>Saves the results to a PDF file after the scan or search is finished. The application will terminate itself after saving. The following example will execute a scan of your local drive C: and save the results to a PDF file:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /PDF "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">C_scan</span><span class="o">.</span><span class="n">pdf</span><span class="s2">"</span> </pre></div> </div> </section> <section id="piechart-filename"> <h3>/PIECHART <filename><a class="headerlink" href="#piechart-filename" title="Link to this heading">¶</a></h3> <p>Saves the pie chart of the scanned directory to a bitmap, GIF, PNG, or JPEG file. The file type depends on the extension of the specified file name. The following example will scan drive C: and export a pie chart in PNG format:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /PIECHART "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Reports</span>\<span class="n">C_pie</span><span class="o">.</span><span class="n">png</span><span class="s2">"</span> </pre></div> </div> </section> <section id="print"> <h3>/PRINT<a class="headerlink" href="#print" title="Link to this heading">¶</a></h3> <p>Prints a report for the scanned directory tree using default printer configured in your system settings. The application will be terminated after printing. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">SERVER\USERS"</span> <span class="o">/</span><span class="n">PRINT</span> </pre></div> </div> </section> <section id="readonlymode-value"> <h3>/READONLYMODE <value><a class="headerlink" href="#readonlymode-value" title="Link to this heading">¶</a></h3> <p>If the value is set to true, this option activates a read-only mode in which file operations (e.g. move, or delete) are disabled, so it will be usable as reporting tool only.</p> <p>Start with a value of false to deactivate the read-only mode again.</p> </section> <section id="recycle"> <h3>/RECYCLE<a class="headerlink" href="#recycle" title="Link to this heading">¶</a></h3> <p>This option can only be used in combination with the command line option /SEARCH.</p> <p>Moves all files to the recycle bin that have been found as result of a TreeSize file search. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SEARCH</span><span class="p">:</span><span class="n">Start</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\t</span><span class="s2">emp"</span> <span class="o">/</span><span class="n">FILTER</span> <span class="s2">"*.tmp"</span> <span class="o">/</span><span class="n">RECYCLE</span> </pre></div> </div> <p>See also: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">Move checked files</span></a></p> </section> <section id="restrictedmode-value"> <h3>/RESTRICTEDMODE <value><a class="headerlink" href="#restrictedmode-value" title="Link to this heading">¶</a></h3> <p>If the value is set to true, this option activates a restricted mode in which many features are disabled that are not of interest for “normal” (non-admin) users. Among the disabled features are: Check for Update, Open Software applet of Windows Control Panel, Schedule TreeSize scans, connect network drive, configure Windows System Restore, Run as administrator, exports, and apply NTFS compression. You can supply a path that should be scanned, e.g. the user’s home directory, at the command line or using the Startup Paths in a saved configuration file.</p> <p>Start with a value of false to deactivate the restricted mode again.</p> <p>If you additionally activate the option /READONLYMODE, the user won’t be able to delete or move files in TreeSize, so it will be usable as reporting tool only.</p> </section> <section id="scan-path-filename"> <h3>/SCAN <path|filename><a class="headerlink" href="#scan-path-filename" title="Link to this heading">¶</a></h3> <p>Defines which drive, or path should be scanned. The scan path should be used as value for this parameter.</p> <p>If, for instance, drive D:\ should be scanned, you can use:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"D:</span><span class="se">\"</span> </pre></div> </div> <p>If you don’t want to scan the whole drive, you can also specify a path, which is used as starting point for the scan. For example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">TreeSize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server\Share\MyDocuments"</span> </pre></div> </div> <p>Multiple scan paths are also possible, they are separated by a blank. Paths containing a blank have to be quoted (“). Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:\Program Files</span><span class="se">\"</span><span class="s2"> "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Windows</span><span class="s2">"</span> </pre></div> </div> <p>The wildcards “*” and “?” are allowed. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"H:\users\A*"</span> </pre></div> </div> <p>You can also specify a text file, which contains a list of paths that should be scanned. TreeSize will scans all paths that are found in the text file, which is specified after this switch. The text file must contain one path per line. The following example scans all paths that are found in the file “D:\PathsToScan.txt” and writes each scan result to a separate sheet in an Excel File with today’s date:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"D:\PathsToScan.txt"</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"D:\Results\%DATE%.xlsx"</span> </pre></div> </div> <p>You may also call TreeSize in a “for” loop with one of the paths only, please find an example below.</p> </section> <section id="search"> <h3>/SEARCH<a class="headerlink" href="#search" title="Link to this heading">¶</a></h3> <p>Opens the File Search window of TreeSize. If “:Start” is added to this command line option, the search is started automatically. A previously saved XML file containing search settings may be passed, these settings will then be used to perform the search.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>Files which are found in this search are automatically checked.</p> </div> <p>The following example performs the search with settings that have previously been saved to the file “SearchSettings.xml” and saves the results to at text file:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SEARCH</span><span class="p">:</span><span class="n">Start</span> <span class="o">/</span><span class="n">OPTIONS</span> <span class="s2">"SearchSettings.xml"</span> <span class="o">/</span><span class="n">TEXT</span> <span class="s2">"T:\SearchResult.txt"</span> </pre></div> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>In general, the last search settings or a former saved set of search settings will be used. However, you can also specify the search patterns for the advanced search using the /FILTER command line option.</p> </div> </section> <section id="sheetname-title"> <h3>/SHEETNAME <title><a class="headerlink" href="#sheetname-title" title="Link to this heading">¶</a></h3> <p>Enables you to specify the name of the sheet that will be added to an Excel file when using the /EXCEL command line switch.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>An Excel sheet name must be unique in an Excel file and certain special characters like slashes, backslashes and colons are forbidden. TreeSize will always create a unique sheet name by replacing invalid character with underscores and by adding date and time if necessary. If a sheet with the specified name already exists in the target file, a new sheet with a unique name is created. Use the command line option /APPENDTOFILES to append the data to the existing sheet.</p> </div> </section> <section id="shortdateformat-format"> <h3>/SHORTDATEFORMAT <format><a class="headerlink" href="#shortdateformat-format" title="Link to this heading">¶</a></h3> <p>Alters the short date format for this process, which can be configured in the regional options of the Windows Control Panel. Exports of TreeSize will use this format for date values. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"E:</span><span class="se">\"</span><span class="s2"> /SHORTDATEFORMAT YYYY-MM-DD /TEXT "</span><span class="n">D</span><span class="p">:</span>\<span class="n">export</span><span class="o">.</span><span class="n">txt</span><span class="s2">"</span> </pre></div> </div> </section> <section id="sizeunit-n"> <h3>/SIZEUNIT <n><a class="headerlink" href="#sizeunit-n" title="Link to this heading">¶</a></h3> <p>This option can be used to specify the unit to be used for displaying size values: N can have the values 0 to 5 which mean: 0 = Bytes, 1 = KB, 2 = MB, 3 = GB, 4 = TB, 5 = Automatic Units. Without this option the last used configuration in TreeSize will be used.</p> </section> <section id="sortby-columnname"> <h3>/SORTBY <ColumnName><a class="headerlink" href="#sortby-columnname" title="Link to this heading">¶</a></h3> <p>Enables you to specify by which value the generated exports will be sorted. Possible values are column names like “Size” or “Name”. The last used sort type in the TreeSize user interface will be used by default. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"E:</span><span class="se">\"</span><span class="s2"> /SORTBY Size /TEXT "</span><span class="n">D</span><span class="p">:</span>\<span class="n">export</span><span class="o">.</span><span class="n">txt</span><span class="s2">"</span> <span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"E:</span><span class="se">\"</span><span class="s2"> /SORTBY Name /EXCEL "</span><span class="n">D</span><span class="p">:</span>\<span class="n">export</span><span class="o">.</span><span class="n">xlsx</span><span class="s2">"</span> </pre></div> </div> </section> <section id="sqlite-filename"> <h3>/SQLITE <filename><a class="headerlink" href="#sqlite-filename" title="Link to this heading">¶</a></h3> <p>Saves the scan results to a SQLite file that can be loaded for comparisons at a later date. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"H:\users</span><span class="se">\"</span><span class="s2"> /SQLITE "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">Allusers</span><span class="o">.</span><span class="n">sqlite</span><span class="s2">"</span> </pre></div> </div> </section> <section id="subject-subject"> <h3>/SUBJECT <subject><a class="headerlink" href="#subject-subject" title="Link to this heading">¶</a></h3> <p>This option allows you to customize the subject that will be used for emails that are sent at the end of the scan. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server\Share"</span> <span class="o">/</span><span class="n">EMAIL</span> <span class="n">treesize</span><span class="nd">@example</span><span class="o">.</span><span class="n">com</span> <span class="o">/</span><span class="n">SUBJECT</span> <span class="s2">"TreeSize Professional Scan Report"</span> </pre></div> </div> </section> <section id="text-filename"> <h3>/TEXT <filename><a class="headerlink" href="#text-filename" title="Link to this heading">¶</a></h3> <p>Saves the results to a text or CSV file after the scan or search is finished. The application will terminate itself after saving. The following example will execute a scan of your local drive C: and save the results to a text file:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /TEXT "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">C_scan</span><span class="o">.</span><span class="n">txt</span><span class="s2">"</span> </pre></div> </div> <p>The text format uses a tabular format targeting human readers. If the filename references a CSV file, the CSV format will be used instead automatically. If you want to use the CSV format explicitly, we recommend to use the /CSV parameter.</p> </section> <section id="title-title"> <h3>/TITLE <title><a class="headerlink" href="#title-title" title="Link to this heading">¶</a></h3> <p>Can be used to replace the root path of a scan with a custom text. This allows to provide more meaningful names for UNC paths for example and thereby increase the readability of a report. The chosen title will be applied as the title of the report when exporting a file. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server3\C$"</span> <span class="o">/</span><span class="n">TITLE</span> <span class="s2">"C: on Data server 3"</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"C:</span><span class="se">\r</span><span class="s2">esult.xlsx"</span> </pre></div> </div> <p>In the context of a TreeSize file search, this parameter can be used to name an advanced search. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SEARCH</span><span class="p">:</span><span class="n">Start</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /TITLE "</span><span class="n">Image</span> <span class="n">files</span><span class="s2">" /FILTER "</span><span class="o">*.</span><span class="n">jpg</span><span class="p">;</span><span class="o">*.</span><span class="n">png</span><span class="p">;</span><span class="o">*.</span><span class="n">bmp</span><span class="s2">" /PDF "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">C_search</span><span class="o">.</span><span class="n">pdf</span><span class="s2">"</span> </pre></div> </div> </section> <section id="topfileslist-filename"> <h3>/TOPFILESLIST <filename><a class="headerlink" href="#topfileslist-filename" title="Link to this heading">¶</a></h3> <p>This option enables you to save the contents of the Top files list to an Excel, HTML, Text, or CSV file. The file type depends on the extension of the specified file name. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /TOPFILESLIST "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Temp</span>\<span class="n">C_top_files</span><span class="o">.</span><span class="n">txt</span><span class="s2">"</span> </pre></div> </div> </section> <section id="treemap-filename"> <h3>/TREEMAP <filename><a class="headerlink" href="#treemap-filename" title="Link to this heading">¶</a></h3> <p>Saves the treemap chart of the scanned directory tree as bitmap, GIF, PNG or JPEG file. The file type depends on the extension of the specified file name. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /TREEMAP "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Dokumente</span>\<span class="n">treemap</span><span class="o">.</span><span class="n">jpg</span><span class="s2">"</span> </pre></div> </div> </section> <section id="uilevel-simple-normal-expert"> <h3>/UILevel <Simple/Normal/Expert><a class="headerlink" href="#uilevel-simple-normal-expert" title="Link to this heading">¶</a></h3> <p>Sets the level of the user interface. Possible values are Simple, Normal, or Expert. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">UILevel</span> <span class="s2">"Simple"</span> </pre></div> </div> </section> <section id="userslist-filename"> <h3>/USERSLIST <filename><a class="headerlink" href="#userslist-filename" title="Link to this heading">¶</a></h3> <p>This option enables you to save the statistics showing the results grouped by username to an Excel, HTML, Text, or CSV file. The file type depends on the extension of the specified file name. The exported columns will be those that were enabled in the user interface on the tab “Users” when it was last used, or at the time when the configuration file supplied via /OPTIONS was written.</p> <p>The following example scans drive C: and creates an Excel file in “C:\Temp” with the statistics of the users on this drive:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /USERSLIST "</span><span class="n">C</span><span class="p">:</span>\<span class="n">temp</span>\<span class="n">C_users</span><span class="o">.</span><span class="n">xls</span><span class="s2">"</span> </pre></div> </div> </section> <section id="username-username"> <h3>/USERNAME <username><a class="headerlink" href="#username-username" title="Link to this heading">¶</a></h3> <p>Specifies the username that should be used to authenticate for the scans. Use /PASSWORD to specify a password for this username. It is recommended to instead use the Microsoft tool RUNAS.</p> </section> <section id="userfilter-username"> <h3>/USERFILTER <username><a class="headerlink" href="#userfilter-username" title="Link to this heading">¶</a></h3> <p>With this option only files owned by a certain user will be taken into account when scanning. Provide the name of this user after this switch.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>You cannot use multiple user names here, but the wildcards “*” and “?” are supported.</p> </div> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server\GroupDrive"</span> <span class="o">/</span><span class="n">USERFILTER</span> <span class="n">miller</span> </pre></div> </div> </section> <section id="userschart-filename"> <h3>/USERSCHART <filename><a class="headerlink" href="#userschart-filename" title="Link to this heading">¶</a></h3> <p>Saves the small graph shown on the bottom of the “Users” page to an image file (bitmap, GIF, PNG, or JPEG).</p> </section> <section id="userspiechart-filename"> <h3>/USERSPIECHART <filename><a class="headerlink" href="#userspiechart-filename" title="Link to this heading">¶</a></h3> <p>Saves a pie chart that shows the “user statistics” of the current scan to an image file (bitmap, GIF, PNG, or JPEG).</p> </section> <section id="viewtype-n"> <h3>/VIEWTYPE n<a class="headerlink" href="#viewtype-n" title="Link to this heading">¶</a></h3> <p>Defines on which values the “Percent of Parent”, the “Growth” columns and the “Age of Files” chart are based. Possible value are:</p> <p>2: Size 3: Allocated Space (Size on disk) 7: Number of Files</p> </section> <section id="xml-filename"> <h3>/XML <filename><a class="headerlink" href="#xml-filename" title="Link to this heading">¶</a></h3> <p>Saves the scan results to a XML file that can be loaded for comparisons at a later date. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"H:\users</span><span class="se">\"</span><span class="s2"> /XML "</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">Allusers</span><span class="o">.</span><span class="n">xml</span><span class="o">.</span><span class="n">zip</span><span class="s2">"</span> </pre></div> </div> <p>This option can be combined with the /EXPAND switch to limit the exported directories.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>When loading a limited XML export to TreeSize, you cannot navigate though the complete directory branch, but only the exported directories.</p> </div> </section> <section id="zip-filename"> <h3>/ZIP <filename><a class="headerlink" href="#zip-filename" title="Link to this heading">¶</a></h3> <p>This option can only be used in combination with the command line option /SEARCH.</p> <p>All files that have been found as result of a TreeSize file search will be moved into a zip archive. Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">SEARCH</span><span class="p">:</span><span class="n">Start</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"C:</span><span class="se">\"</span><span class="s2"> /ZIP "</span><span class="n">C</span><span class="p">:</span>\<span class="n">OldFiles</span>\<span class="n">Archive</span><span class="o">.</span><span class="n">zip</span><span class="s2">"</span> </pre></div> </div> <p>See also: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">Move checked files</span></a></p> </section> <section id="scanpath"> <h3><SCANPATH><a class="headerlink" href="#scanpath" title="Link to this heading">¶</a></h3> <p>In addition to the parameter /SCAN, you may also pass one or more paths at the end of the command line. This is no longer recommended though to avoid errors when parsing the command line.</p> <p>This example scans the “Program Files”, and the “Windows” folder, and creates a text report under “C:\Reports\ScanResults.txt”:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">TEXT</span> <span class="s2">"C:\Reports\ScanResults.txt"</span> <span class="s2">"C:\Program Files"</span> <span class="s2">"C:\Windows"</span> </pre></div> </div> <p>In case an error occurs, it will be returned as Windows error code in the exit code of the process. Environment variables (e.g. %APPDATA%) can be used In file names for the export as well as in the scanned paths.</p> </section> </section> <section id="scanning-multiple-directories"> <h2>Scanning Multiple Directories<a class="headerlink" href="#scanning-multiple-directories" title="Link to this heading">¶</a></h2> <p>If you need to scan multiple directories, it might be a good idea to merge several calls in a Batch file, for example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">START</span> <span class="o">/</span><span class="n">WAIT</span> <span class="s2">"TreeSize"</span> <span class="s2">"C:\Program Files\JAM Software\TreeSize\Treesize.exe"</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server\Share1"</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"D:\Share1.xls"</span> <span class="n">START</span> <span class="o">/</span><span class="n">WAIT</span> <span class="s2">"TreeSize"</span> <span class="s2">"C:\Program Files\JAM Software\TreeSize\Treesize.exe"</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server\Share2"</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"D:\Share2.xls"</span> <span class="n">START</span> <span class="o">/</span><span class="n">WAIT</span> <span class="s2">"TreeSize"</span> <span class="s2">"C:\Program Files\JAM Software\TreeSize\Treesize.exe"</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server\Share3"</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"D:\Share3.xls"</span> </pre></div> </div> <p>The command “START /WAIT” ensures that the jobs start sequentially. Not starting the jobs parallel is usually better because a single job takes more advantage from caches and system resources. It is also possible to store the shares that should be scanned in a text file and use the Windows “for” command like this:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">FOR</span> <span class="o">/</span><span class="n">F</span> <span class="o">%%</span><span class="n">p</span> <span class="n">IN</span> <span class="p">(</span><span class="n">Paths</span><span class="o">.</span><span class="n">txt</span><span class="p">)</span> <span class="n">DO</span> <span class="n">START</span> <span class="o">/</span><span class="n">WAIT</span> <span class="n">Treesize</span><span class="o">.</span><span class="n">exe</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="si">%%</span><span class="s2">p"</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"c:</span><span class="se">\t</span><span class="s2">emp\TreeSize-Reports-%DATE%.xls"</span> <span class="n">FOR</span> <span class="o">/</span><span class="n">F</span> <span class="s2">"tokens=1"</span> <span class="o">%%</span><span class="n">i</span> <span class="n">IN</span> <span class="p">(</span><span class="n">Shares</span><span class="o">.</span><span class="n">txt</span><span class="p">)</span> <span class="n">DO</span> <span class="n">START</span> <span class="o">/</span><span class="n">WAIT</span> <span class="n">Treesize</span><span class="o">.</span><span class="n">exe</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">"</span><span class="se">\\</span><span class="s2">Server\</span><span class="si">%%</span><span class="s2">i"</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">"c:</span><span class="se">\t</span><span class="s2">emp\</span><span class="si">%%</span><span class="s2">i.xls"</span> </pre></div> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>The double percent characters are required in batch files, on the command line use a single percent only.</p> </div> </section> <section id="scheduled-start"> <h2>Scheduled Start<a class="headerlink" href="#scheduled-start" title="Link to this heading">¶</a></h2> <p>You can use the Windows Scheduled Tasks to run TreeSize with certain command line options daily, weekly, or monthly at a certain time. The dialog for <a class="reference internal" href="schedule_scans.html#scheduling-scans"><span class="std std-ref">Scheduling scans</span></a> will help you setting up a scheduled task.</p> <p>You can also use the <code class="docutils literal notranslate"><span class="pre">SCHTASKS</span></code> command to perform scheduled scans. If you, for example, want to scan the drives C: and E: next night at 03:00 a.m. and save the results to an Excel file, you could use the following command line:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">SCHTASKS</span> <span class="o">/</span><span class="n">Create</span> <span class="o">/</span><span class="n">SC</span> <span class="n">DAILY</span> <span class="o">/</span><span class="n">ST</span> <span class="mi">03</span><span class="p">:</span><span class="mi">00</span> <span class="o">/</span><span class="n">TN</span> <span class="n">TreeSizeScan</span> <span class="o">/</span><span class="n">TR</span> <span class="s2">"'C:\Program Files\JAM Software\TreeSize\Treesize.exe' /SCAN C:\ E:\ /EXCEL C:\Temp</span><span class="se">\t</span><span class="s2">sp.xls /EXPAND 2"</span> </pre></div> </div> <p>Get help about the <code class="docutils literal notranslate"><span class="pre">SCHTASKS</span></code> command on <a class="reference external" href="https://technet.microsoft.com/en-us/library/ff356867.aspx?f=255&MSPPError=-2147217396">Microsoft’s pages</a> or by typing:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>SCHTAKS /Create /? </pre></div> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>Error messages occurring during scheduled scans are listed in the systems Windows event log.</p> </div> </section> <section id="powershell"> <h2>PowerShell<a class="headerlink" href="#powershell" title="Link to this heading">¶</a></h2> <p>Windows PowerShell can be useful in combination with TreeSize. This example shows how to search a couple of remote computers that are queried using an LDAP query in the Active Directory (AD):</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$computer = Get-ADComputer -SearchBase "ou=client computers,ou=intranet,dc=intranet,dc=jam-software,dc=com" -Filter * foreach ($comp in $computer.name) { $path = "\\$comp\C$\Windows" Add-Content Scan.txt "$path" } #debug Get-Content -Path Scan.txt # start TreeSize with the collected paths &"C:\Program Files\JAM Software\TreeSize\Treesize.exe" /SEARCH:Start /SCAN Scan.txt /FILTER *.exe /Export FoundFiles.txt </pre></div> </div> </section> <section id="redirecting-output"> <h2>Redirecting Output<a class="headerlink" href="#redirecting-output" title="Link to this heading">¶</a></h2> <p>If no other export target is given, TreeSize will write a short export of the scan to the standard output, and errors that occurred during the scan to the standard error.</p> <p>You can redirect these output streams on the command line (cmd.exe) using the pipe symbol, e.g.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"C:\Program Files\JAM Software\TreeSize\Treesize.exe"</span> <span class="o">/</span><span class="n">NOGUI</span> <span class="o">/</span><span class="n">SCAN</span> <span class="n">C</span><span class="p">:</span>\ <span class="mi">1</span><span class="o">></span><span class="n">StdOut</span><span class="o">.</span><span class="n">txt</span> <span class="mi">2</span><span class="o">></span><span class="n">StdError</span><span class="o">.</span><span class="n">txt</span> </pre></div> </div> <p>To redirect the output using the PowerShell, please use the Start-Process command instead, e.g.</p> <p>Start-Process -FilePath “C:\Program Files\JAM Software\TreeSize\Treesize.exe” -ArgumentList “/NOGUI /SCAN C:\” -RedirectStandardOutput “.\StdOut.txt” -RedirectStandardError “.\StdError.txt”</p> </section> <section id="windows-scripting-host"> <h2>Windows Scripting Host<a class="headerlink" href="#windows-scripting-host" title="Link to this heading">¶</a></h2> <p>If you intend to use the Windows Scripting Host (WSH), your command to start TreeSize will look like:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Set</span> <span class="n">Shell</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s2">"WScript.Shell"</span><span class="p">)</span> <span class="n">Shell</span><span class="o">.</span><span class="n">Run</span> <span class="s2">"""C:\Program Files\TreeSize\Treesize.exe"" /XML ""C:\Reports\drive_c.xml.zip"" /SCAN ""C:</span><span class="se">\"</span><span class="s2">""</span> </pre></div> </div> </section> <section id="exit-codes"> <h2>Exit Codes<a class="headerlink" href="#exit-codes" title="Link to this heading">¶</a></h2> <p>If the operation was completed successfully, the exit code is 0. If an error occurred TreeSize will return a <a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx">Windows error code</a> as exit code if available, or 1 to indicate a general error.</p> <p>In any case the Windows Event Log will contain further information in the “Application” log, Event Source “TreeSize”.</p> </section> </section> </article> </div> <footer> <div class="related-pages"> <a class="next-page" href="example_schedule_filesearch.html"> <div class="page-info"> <div class="context"> <span>Next</span> </div> <div class="title">How to schedule a file search</div> </div> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> </a> <a class="prev-page" href="scheduler_all_task_tab.html"> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> <div class="page-info"> <div class="context"> <span>Previous</span> </div> <div class="title">All Tasks</div> </div> </a> </div> <div class="bottom-of-page"> <div class="left-details"> <div class="copyright"> Copyright © 1995 - 2025 Joachim Marder e.K. </div> Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s <a href="https://github.com/pradyunsg/furo">Furo</a> </div> <div class="right-details"> </div> </div> </footer> </div> <aside class="toc-drawer"> <div class="toc-sticky toc-scroll"> <div class="toc-title-container"> <span class="toc-title"> On this page </span> </div> <div class="toc-tree-container"> <div class="toc-tree"> <ul> <li><a class="reference internal" href="#">Command line options</a><ul> <li><a class="reference internal" href="#all-options">All options</a><ul> <li><a class="reference internal" href="#or-help">/? or /HELP</a></li> <li><a class="reference internal" href="#ageoffiles">/AGEOFFILES</a></li> <li><a class="reference internal" href="#appendtofiles-value">/APPENDTOFILES <value></a></li> <li><a class="reference internal" href="#archivebitfilesonly">/ARCHIVEBITFILESONLY</a></li> <li><a class="reference internal" href="#attach">/ATTACH</a></li> <li><a class="reference internal" href="#barchart-filename">/BARCHART <filename></a></li> <li><a class="reference internal" href="#compare-filename-path">/COMPARE <filename|path></a></li> <li><a class="reference internal" href="#copy-path">/COPY <path></a></li> <li><a class="reference internal" href="#createdpastdaysonly-n">/CREATEDPASTDAYSONLY <n></a></li> <li><a class="reference internal" href="#createsnapshot-drive">/CREATESNAPSHOT <drive></a></li> <li><a class="reference internal" href="#csv-filename">/CSV <filename></a></li> <li><a class="reference internal" href="#date">/DATE</a></li> <li><a class="reference internal" href="#deduplicate">/DEDUPLICATE</a></li> <li><a class="reference internal" href="#delete">/DELETE</a></li> <li><a class="reference internal" href="#email-recipient">/EMAIL <recipient></a></li> <li><a class="reference internal" href="#emailifresultsfound">/EMAILIFRESULTSFOUND</a></li> <li><a class="reference internal" href="#emptyrecyclebin">/EMPTYRECYCLEBIN</a></li> <li><a class="reference internal" href="#execute-filename">/EXECUTE <filename></a></li> <li><a class="reference internal" href="#excel-filepath">/EXCEL <filepath></a></li> <li><a class="reference internal" href="#exclude-pattern1-pattern2">/EXCLUDE <pattern1;pattern2></a></li> <li><a class="reference internal" href="#expand-level-size">/EXPAND <level|size></a></li> <li><a class="reference internal" href="#expandablereport-value">/EXPANDABLEREPORT <value></a></li> <li><a class="reference internal" href="#exportdriveslist-filename">/EXPORTDRIVESLIST <filename></a></li> <li><a class="reference internal" href="#exportfiles">/EXPORTFILES</a></li> <li><a class="reference internal" href="#exportgroupsexpanded">/EXPORTGROUPSEXPANDED</a></li> <li><a class="reference internal" href="#exportpathslist-filename">/EXPORTPATHSLIST <filename></a></li> <li><a class="reference internal" href="#exporttitle-title">/EXPORTTITLE <title></a></li> <li><a class="reference internal" href="#extensionslist-filename">/EXTENSIONSLIST <filename></a></li> <li><a class="reference internal" href="#extensionschart-filename">/EXTENSIONSCHART <filename></a></li> <li><a class="reference internal" href="#extensionspiechart-filename">/EXTENSIONSPIECHART <filename></a></li> <li><a class="reference internal" href="#filter-pattern1-pattern2">/FILTER <pattern1;pattern2></a></li> <li><a class="reference internal" href="#followreparsepoints">/FOLLOWREPARSEPOINTS</a></li> <li><a class="reference internal" href="#groupscans">/GROUPSCANS</a></li> <li><a class="reference internal" href="#hidesmallfolders-value">/HIDESMALLFOLDERS <value></a></li> <li><a class="reference internal" href="#historychart-filename">/HISTORYCHART <filename></a></li> <li><a class="reference internal" href="#html-filename">/HTML <filename></a></li> <li><a class="reference internal" href="#import-filename">/IMPORT <filename></a></li> <li><a class="reference internal" href="#importpatterns-filename">/IMPORTPATTERNS <filename></a></li> <li><a class="reference internal" href="#indexfile-filename">/INDEXFILE <filename></a></li> <li><a class="reference internal" href="#listseparator-separator-char">/LISTSEPARATOR <separator char></a></li> <li><a class="reference internal" href="#move-path">/MOVE <path></a></li> <li><a class="reference internal" href="#nogui">/NOGUI</a></li> <li><a class="reference internal" href="#noheaders">/NOHEADERS</a></li> <li><a class="reference internal" href="#nounits">/NOUNITS</a></li> <li><a class="reference internal" href="#open-filename">/OPEN <filename></a></li> <li><a class="reference internal" href="#options-filename">/OPTIONS <filename></a></li> <li><a class="reference internal" href="#pdf">/PDF</a></li> <li><a class="reference internal" href="#piechart-filename">/PIECHART <filename></a></li> <li><a class="reference internal" href="#print">/PRINT</a></li> <li><a class="reference internal" href="#readonlymode-value">/READONLYMODE <value></a></li> <li><a class="reference internal" href="#recycle">/RECYCLE</a></li> <li><a class="reference internal" href="#restrictedmode-value">/RESTRICTEDMODE <value></a></li> <li><a class="reference internal" href="#scan-path-filename">/SCAN <path|filename></a></li> <li><a class="reference internal" href="#search">/SEARCH</a></li> <li><a class="reference internal" href="#sheetname-title">/SHEETNAME <title></a></li> <li><a class="reference internal" href="#shortdateformat-format">/SHORTDATEFORMAT <format></a></li> <li><a class="reference internal" href="#sizeunit-n">/SIZEUNIT <n></a></li> <li><a class="reference internal" href="#sortby-columnname">/SORTBY <ColumnName></a></li> <li><a class="reference internal" href="#sqlite-filename">/SQLITE <filename></a></li> <li><a class="reference internal" href="#subject-subject">/SUBJECT <subject></a></li> <li><a class="reference internal" href="#text-filename">/TEXT <filename></a></li> <li><a class="reference internal" href="#title-title">/TITLE <title></a></li> <li><a class="reference internal" href="#topfileslist-filename">/TOPFILESLIST <filename></a></li> <li><a class="reference internal" href="#treemap-filename">/TREEMAP <filename></a></li> <li><a class="reference internal" href="#uilevel-simple-normal-expert">/UILevel <Simple/Normal/Expert></a></li> <li><a class="reference internal" href="#userslist-filename">/USERSLIST <filename></a></li> <li><a class="reference internal" href="#username-username">/USERNAME <username></a></li> <li><a class="reference internal" href="#userfilter-username">/USERFILTER <username></a></li> <li><a class="reference internal" href="#userschart-filename">/USERSCHART <filename></a></li> <li><a class="reference internal" href="#userspiechart-filename">/USERSPIECHART <filename></a></li> <li><a class="reference internal" href="#viewtype-n">/VIEWTYPE n</a></li> <li><a class="reference internal" href="#xml-filename">/XML <filename></a></li> <li><a class="reference internal" href="#zip-filename">/ZIP <filename></a></li> <li><a class="reference internal" href="#scanpath"><SCANPATH></a></li> </ul> </li> <li><a class="reference internal" href="#scanning-multiple-directories">Scanning Multiple Directories</a></li> <li><a class="reference internal" href="#scheduled-start">Scheduled Start</a></li> <li><a class="reference internal" href="#powershell">PowerShell</a></li> <li><a class="reference internal" href="#redirecting-output">Redirecting Output</a></li> <li><a class="reference internal" href="#windows-scripting-host">Windows Scripting Host</a></li> <li><a class="reference internal" href="#exit-codes">Exit Codes</a></li> </ul> </li> </ul> </div> </div> </div> </aside> </div> </div><script src="_static/documentation_options.js?v=5929fcd5"></script> <script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/scripts/furo.js?v=46bd48cc"></script> </body> </html>