Knowledge Base


Question / Problem

Is there a way to use the command line to search for files that e.g. have not changed in x days and then delete them automatically? Currently we are doing this manually but would like to schedule it as a daily or weekly task.

Answer / Solution

The TreeSize File Search can search, report and delete files fulfilling certain criteria. For security reasons we have designed the deleting operation bypassing the recycle bin not to be scriptable - with the exception of the possibility to move the files, which is available through the command line option /MOVETO (Professional Edition only). Any search options saved to an XML file can be passed at the command line and the found results can be moved using a command line like this:

TreeSize.EXE /SEARCH /MOVETO "C:\Temp\TST\Moved" "C:\Temp\TSP\Files ending with TMP.xml".

You may pass a ZIP-file or the "Recycle Bin" as destination as well:

TreeSize.EXE /SEARCH /MOVETO "Recycle Bin" "C:\Temp\TSP\Files ending with TMP.xml"