### TreeSize Filter Definition Examples Source: https://manuals.jam-software.com/treesize/EN/searchfilter_definition Examples demonstrating the use of 'matches pattern' and 'matches Regular Expression' for file name and path filtering in TreeSize. These examples illustrate wildcard usage and regular expression syntax for specific search criteria. ```regex Name | matches pattern | `.doc` | Searches for all files with the extension ".doc". ``` ```regex Name | matches Regular Expression | `[^x00-x7F]` | Find all files/folders with invalid ASCII characters. ``` ```regex Full path | matches pattern | `*\Windows\System32\*.exe` | Searches for all applications in the path “Windows\System32”. ``` ```regex Name | matches Regular Expression | `(?=.*a)(?=.*b)` | Find all files/folders containing at least one “a” character and one “b” character. ``` ```regex Name | matches pattern | `admin*` | Searches for all files with a file owner starting with “admin…” (e.g. “Administrator” or “Administrators”). ``` -------------------------------- ### Run TreeSize via Windows Scripting Host Source: https://manuals.jam-software.com/treesize/EN/command_line_opt This VBScript example demonstrates how to launch TreeSize.exe using the Windows Scripting Host (WSH). It creates a 'WScript.Shell' object, then uses the 'Run' method to execute TreeSize with XML export and a specified scan path. Double quotes are used to properly escape paths containing spaces. ```vbscript Set Shell = CreateObject("WScript.Shell") Shell.Run """C:\Program Files\TreeSize\Treesize.exe"" /XML ""C:\Reports\drive_c.xml.zip"" /SCAN ""C:\""" ``` -------------------------------- ### Scan Multiple Directories with Batch Commands Source: https://manuals.jam-software.com/treesize/EN/command_line_opt This batch script demonstrates how to sequentially scan multiple network shares using TreeSize.exe, saving each scan result to a separate Excel file. The 'START /WAIT' command ensures that each scan completes before the next one begins, optimizing resource utilization. ```batch START /WAIT "TreeSize" "C:\Program Files\JAM Software\TreeSize\Treesize.exe" /SCAN \\Server\Share1 /EXCEL D:\Share1.xls START /WAIT "TreeSize" "C:\Program Files\JAM Software\TreeSize\Treesize.exe" /SCAN \\Server\Share2 /EXCEL D:\Share2.xls START /WAIT "TreeSize" "C:\Program Files\JAM Software\TreeSize\Treesize.exe" /SCAN \\Server\Share3 /EXCEL D:\Share3.xls ``` -------------------------------- ### Scan Directories from a Text File with Batch Source: https://manuals.jam-software.com/treesize/EN/command_line_opt This batch script automates scanning directories listed in a text file (Paths.txt). It iterates through each path, initiating a TreeSize scan and exporting the results to a dated Excel file. An alternative example shows scanning network shares listed in Shares.txt. ```batch FOR /F %%p IN (Paths.txt) DO START /WAIT Treesize.exe /SCAN "%%p" /EXCEL "c:\temp\TreeSize-Reports-%DATE%.xls" FOR /F "tokens=1" %%i IN (Shares.txt) DO START /WAIT Treesize.exe /SCAN "\\Server\%%i" /EXCEL "c:\temp\%%i.xls" ``` -------------------------------- ### Follow Symbolic Links with /FOLLOWREPARSEPOINTS Source: https://manuals.jam-software.com/treesize/EN/command_line_opt Enables TreeSize to follow mount points and external symbolic links when scanning a file system. This ensures a complete scan of linked directories. ```command-line TreeSize /FOLLOWREPARSEPOINTS /SCAN C:\ ``` -------------------------------- ### Redirect TreeSize Output to Files (cmd.exe) Source: https://manuals.jam-software.com/treesize/EN/command_line_opt This command line example shows how to redirect the standard output and standard error streams from TreeSize.exe to separate files. '/NOGUI' suppresses the graphical interface, '/SCAN C:\' initiates a scan of the C: drive, '1>StdOut.txt' redirects standard output, and '2>StdError.txt' redirects standard error. ```batch "C:\Program Files\JAM Software\TreeSize\Treesize.exe" /NOGUI /SCAN C:\ 1>StdOut.txt 2>StdError.txt ``` -------------------------------- ### Import File List for Search with /IMPORT Source: https://manuals.jam-software.com/treesize/EN/command_line_opt Loads a list of paths from a .txt or .csv file into the TreeSize file search interface. This can be combined with /RECYCLE, /DELETE, or /MOVE for batch operations on the imported files. ```command-line Treesize /SEARCH /IMPORT "C:\Results\filelist.txt" ``` ```command-line Treesize /SEARCH /IMPORT "C:\Results\filesToDelete.csv" /RECYCLE ``` -------------------------------- ### Export Search Results Path List Source: https://manuals.jam-software.com/treesize/EN/command_line_opt Exports a simple list containing only the full paths of search results. This option must be used with the /SEARCH command line option. Supported formats are .txt and .csv. It can be used to import search results back into the UI. ```command-line Treesize /SEARCH:Start /SCAN "C:\" /FILTER "*.exe" /EXPORTPATHSLIST "C:\Results\SearchResults.csv" ``` -------------------------------- ### Save Users Chart to Image File Source: https://manuals.jam-software.com/treesize/EN/command_line_opt Saves the small graph from the 'Users' page to an image file. Supported formats include bitmap, GIF, PNG, and JPEG. ```Shell Treesize /SCAN "C:\" /USERSCHART "C:\Reports\users_chart.png" ``` -------------------------------- ### Define Values for Report Columns and Charts Source: https://manuals.jam-software.com/treesize/EN/command_line_opt Sets the basis for 'Percent of Parent', 'Growth' columns, and the 'Age of Files' chart. Possible values are Size (2), Allocated Space (3), or Number of Files (7). ```Shell Treesize /VIEWTYPE 3 ``` -------------------------------- ### Export Scan to HTML with /HTML Source: https://manuals.jam-software.com/treesize/EN/command_line_opt Saves collected scan data to an HTML file for viewing in a browser. Users can configure which charts and lists are included. Overwrites existing files unless /APPENDTOFILES or /GROUPSCANS is used. ```command-line Treesize /SCAN "C:\" /HTML "D:\HTML\treesize.html" ``` ```command-line Treesize /GROUPSCANS /SCAN C:\ D:\ /HTML "D:\HTML\combined_scan.html" ``` -------------------------------- ### Save Users Pie Chart to Image File Source: https://manuals.jam-software.com/treesize/EN/command_line_opt Saves a pie chart representing user statistics for the current scan to an image file. Supported formats include bitmap, GIF, PNG, and JPEG. ```Shell Treesize /SCAN "C:\" /USERSPIECHART "C:\Reports\users_piechart.png" ``` -------------------------------- ### Redirect TreeSize Output with PowerShell Source: https://manuals.jam-software.com/treesize/EN/command_line_opt This PowerShell command uses 'Start-Process' to execute TreeSize.exe. It redirects the standard output to '.StdOut.txt' and standard error to '.StdError.txt'. The '/NOGUI' option is used to run TreeSize without its graphical user interface, and '/SCAN C:\' specifies the directory to scan. ```powershell Start-Process -FilePath “C:\Program Files\JAM Software\TreeSize\Treesize.exe” -ArgumentList “/NOGUI /SCAN C:\” -RedirectStandardOutput “.\StdOut.txt” -RedirectStandardError “.\StdError.txt” ```