1. Deduplicate

1.1. Fix Drive

  • Start TreeSize Duplicate File Search.

  • Select Duplicate Files tab.

  • Check Ignore NTFS hardlinks.

  • Optional: Remove any (UNC-) path in Predefined field.

  • Click on the empty Predefined field.

  • Select D:\ or E:\ drive.

  • Add the following filers.

    Duplicate file search - filters
    And
        Size        >=                      1KB
        Name        does not contain        .DAT
        Name        does not contain        .INI
        Name        does not match pattern  *\$Recycle.Bin*
        Name        does not match pattern  *\~Snapshot\*
        Name        does not match pattern  *\WINSXS*
        Name        does not match pattern  *\RECYCL*
        Name        does not match pattern  %SystemRoot%\Sys*
        Name        does not match pattern  "*\System Volume Information\*"
  • Click Start.

  • Wait for the search to finish.

  • Check Name to check all the duplicate files.

  • Click Deduplicate.

  • Click OK.

  • Wait for the deduplication to finish.

  • Close TreeSize.

2. TreeSize Schedule Tasks

2.1. Duplicate Files

  • Note: Connect the network drives for duplicate files fix. The user should has Full control permission on the network drive.

  • Start TreeSize Duplicate File Search.

  • Select Duplicate Files tab.

  • Check Ignore NTFS hardlinks.

  • Optional: Remove any (UNC-) path in Predefined field.

  • Click on the empty Predefined field.

  • Check the UNC path or Network drive that you want to fix the duplicate files.

  • Note: If many network drives are in the same disk, check all those network drives.

  • Click on the Predefined field to collapse the dropdown list.

  • Under the Duplicate file search - filters, make the size greater than or equal to 1 KB (Size >= 1 KB).

  • Click Start.

  • Wait for the search to finish.

  • Select Tools tab.

  • Select Schedule current search.

  • Select Options sub menu.

    Path(s) to scan
    "P:\" "S:\" "T:\" "U:\"
    
    Options File
    ■ Use saved options:    C:\ProgramData\JAM Software\TreeSize\File Search\ScheduledFileSearchOptions.xml
    
    Export Options
    Sort By:                No sorting
    Size Unit:              Current setting from user interface
    ■ Include units in export
    
    Filter
    □ Exclude following file types:
    □ Include only following file types:
  • Click Export sub menu.

    General Options
    □ Add date and time to filenames
      ○ Overwrite existing files
      ● Append to existing files
    
    Export search results
    □ Excel file:
      ○ Automatically generated sheet name (including date and time)
      ○ Sheet name:
    □ HTML file:
    ■ Text/CSV file:
    □ PDF file:
    ■ Send email:           smru-it@shoklo-unit.com
    □ List of Paths:
      □ Attach generated files to email
      □ Send email only if results were found
  • Click Configure.

    Email content
      To:                   smru-it@shoklo-unit.com
      Subject               TreeSize Report
      Format:               HTML
    
    Transport
      ○ Use MAPI client
      ● Use SMTP server (required fo scheduled tasks)
        SMTP connection settings
          From:             TBHF-SYS-MRM@shoklo-unit.com
          Server:           10.10.1.170
          Port:             25
          □ Use secure (SSL) connection
          □ This server requires authentication
          Username:
          Password:
  • Click Apply.

  • Click OK.

  • Select Move Operation sub menu.

  • Choose No operation.

  • Optional: Select Advanced sub menu.

  • Optional: Select Command Line sub menu.

  • Optional: Select Schedule sub menu.

  • Click Save Task.

  • Type the Administrator password in the Password field.

  • Click OK.

  • Click OK.

  • Click Close.

  • Close TreeSize.

2.1.1. SMTP Mail Server

  • Logon as <User>.

  • Start TreeSize.

  • Select Tools tab.

  • Select Options > Options.

  • Select Export > Email.

    Email content
      To:                   smru-it@shoklo-unit.com
      Subject               TreeSize Report
      Format:               HTML
    
    Transport
      ○ Use MAPI client
      ● Use SMTP server (required fo scheduled tasks)
        SMTP connection settings
          From:             TBHF-SYS-MRM@shoklo-unit.com
          Server:           10.10.1.170
          Port:             25
          □ Use secure (SSL) connection
          □ This server requires authentication
          Username:
          Password:
  • Click Apply.

  • Click OK.

  • Close TreeSize.

2.2. Task With Command Line

  • Note: Make sure the ScheduledFileSearchOptions.xml file contain the following line.

    <AutoCheckResults>True</AutoCheckResults>
    <DuplicatesIgnoreHardLinks>True</DuplicatesIgnoreHardLinks>
    <DeduplicateLogFile>C:\Users\<User>\AppData\Roaming\JAM Software\TreeSize\Log\_DeduplicationLog.txt</DeduplicateLogFile>
  • Enter the following commands at a Command Prompt.

    # List the duplicate files exclude hardlinks
    "C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /SEARCH:Start /NOGUI /OPTIONS "C:\ProgramData\JAM Software\TreeSize\File Search\ScheduledFileSearchOptions.xml" /EMAIL "smru-it@shoklo-unit.com" /SUBJECT "TreeSize: duplicate files exclude hardlink" /DATE /APPENDTOFILES True /EXPORTTITLE "TreeSize Report duplicate files exclude hardlink" /TEXT "C:\Tmp\TreeSize-log\_TreeSize-log.txt" "P:\" "S:\" "T:\" "U:\"
    
    # Fix the duplicate files
    "C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /SEARCH:Start /DEDUPLICATE /NOGUI /OPTIONS "C:\ProgramData\JAM Software\TreeSize\File Search\ScheduledFileSearchOptions.xml" /EMAIL "smru-it@shoklo-unit.com" /SUBJECT "TreeSize: duplicate files exclude hardlink" /DATE /APPENDTOFILES True /EXPORTTITLE "TreeSize Report duplicate files exclude hardlink" /TEXT "C:\Tmp\TreeSize-log\_TreeSize-log.txt" "P:\" "S:\" "T:\" "U:\"
    
    # List the duplicate files exclude hardlinks
    "C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /SEARCH:Start /NOGUI /OPTIONS "C:\Users\ADadmin\AppData\Roaming\JAM Software\TreeSize\ScheduledFileSearchOptions.xml" /EMAIL "smru-it@shoklo-unit.com" /SUBJECT "TreeSize: duplicate files exclude hardlink" /DATE /APPENDTOFILES True /EXPORTTITLE "TreeSize Report duplicate files exclude hardlink" /TEXT "C:\Tmp\TreeSize-log\_TreeSize-log.txt" "P:\" "S:\" "T:\" "U:\"
    
    # Fix the duplicate files
    "C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /SEARCH:Start /DEDUPLICATE /NOGUI /OPTIONS "C:\Users\ADadmin\AppData\Roaming\JAM Software\TreeSize\ScheduledFileSearchOptions.xml" /EMAIL "smru-it@shoklo-unit.com" /SUBJECT "TreeSize: duplicate files exclude hardlink" /DATE /APPENDTOFILES True /EXPORTTITLE "TreeSize Report duplicate files exclude hardlink" /TEXT "C:\Tmp\TreeSize-log\_TreeSize-log.txt" "P:\" "S:\" "T:\" "U:\"

3. Windows Task Scheduler

"C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /SEARCH:Start /DEDUPLICATE /NOGUI /OPTIONS "C:\Users\ADadmin\AppData\Roaming\JAM Software\TreeSize\FileSearchOptions.xml" /EMAIL "smru-it@shoklo-unit.com" /SUBJECT "SMRU TreeSize: Deduplicate files on SMRU-SRV D: drive." /DATE /APPENDTOFILES True /EXPORTTITLE "List of duplicate files on SMRU-SRV D: drive with ignore NTFS hard links" /TEXT "C:\Users\ADadmin\AppData\Roaming\JAM Software\TreeSize\Log\TreeSize-Log.txt" "D:\"

Prepare SMRU\ADadmin user to have batch job privileges.

  • Run the secpol.msc command with administrative privileges.

  • Select Security Settings > Local Policies > User Rights Assignment.

  • Double-click Log on as a batch job.

  • Select Local Security Setting.

  • Click Add User or Group.

  • Type ADadmin in the Enter the object names to select field.

  • Click Check Names.

  • Type the domain user and password on the Enter network credentials window.

  • Click OK.

  • Click OK.

  • Click Apply.

  • Click OK.

  • Close Local Security Policy.

  • Start Task Scheduler with administrative privileges.

  • Right-click Task Scheduler Library and select Create Task.

  • Select General tab.

  • Type SMRU-TreeSize-Deduplication in the Name field.

  • Select Change User or Group.

  • Click Locations.

  • Type the domain user and password on the Enter network credentials window.

  • Click OK.

  • Select Entire Directory.

  • Click OK.

  • Type ADadmin in the Enter the object names to select field.

  • Click Check Names.

  • Optional: Type the domain user and password on the Enter network credentials window.

  • Optional: Click OK.

  • Click OK.

  • Choose Run whether user is logged on or not.

  • Check Run with highest privileges.

  • Select Windows 10 for Configure for.

  • Select Triggers tab.

  • Click New.

  • Click OK.

  • Select Actions tab.

  • Click New.

  • Select Start a program for Action.

  • Type "C:\Program Files\JAM Software\TreeSize\TreeSize.exe" in the Program/script field.

  • Type /SEARCH:Start /DEDUPLICATE /NOGUI /OPTIONS "C:\Users\ADadmin\AppData\Roaming\JAM Software\TreeSize\FileSearchOptions.xml" /EMAIL "smru-it@shoklo-unit.com" /SUBJECT "SMRU TreeSize: Deduplicate files on SMRU-SRV D: drive." /DATE /APPENDTOFILES True /EXPORTTITLE "List of duplicate files on SMRU-SRV D: drive with ignore NTFS hard links" /TEXT "C:\Users\ADadmin\AppData\Roaming\JAM Software\TreeSize\Log\TreeSize-Log.txt" "D:\" in the Add arguments (optional) field.

  • Click OK.

  • Optional: Select Conditions tab.

  • Optional: Select Settings tab.

  • Click OK.

  • Type the password for SMRU\adadmin in the Password field.

  • Click OK.

4. TBHF-SYS-MRM

  • Run regedit.exe.

  • Open the path HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters.

  • Right-click and select New > DWORD (32-bit) value.

  • Set the name to FileInfoCacheLifetime and the value to 0.

  • Restart the computer.