<!doctype html>
<html class="no-js" lang="zh-Hans" data-content_root="./">
  <head><meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="index" title="Index" href="genindex.html"><link rel="search" title="Search" href="search.html"><link rel="next" title="如何安排文件搜索" href="example_schedule_filesearch.html"><link rel="prev" title="所有任务" href="scheduler_all_task_tab.html">
        <link rel="prefetch" href="_static/JAM_Logo_Help_Dark.png" as="image">
        <link rel="prefetch" href="_static/JAM_Logo_Help_Dark.png" as="image">

    <!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25 -->
        <title>命令行选项 - TreeSize</title>
      <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
    <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
    <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
    
    


<style>
  body {
    --color-code-background: #eeffcc;
  --color-code-foreground: black;
  --color-background-primary: #FFFFFF;
  --color-sidebar-background: #252E30;
  --color-sidebar-search-background: #252E30;
  --color-sidebar-link-text: #9DA0A5;
  --color-background-border: #494e50;
  --color-brand-primary: #FFFFFF;
  --color-brand-content: #445559;
  --color-brand-visited: #445559;
  --color-sidebar-brand-text: #FFFFFF;
  --color-background-hover: #445559;
  --color-background-hover--transparent: #252E30;
  
  }
  @media not print {
    body[data-theme="dark"] {
      --color-code-background: #202020;
  --color-code-foreground: #d0d0d0;
  --color-background-secondary: #252E30;
  --color-brand-primary: #F3F3F3;
  --color-brand-content: #FFFFFF;
  --color-brand-visited: #FFFFFF;
  --color-background-border: #494e50;
  
    }
    @media (prefers-color-scheme: dark) {
      body:not([data-theme="light"]) {
        --color-code-background: #202020;
  --color-code-foreground: #d0d0d0;
  --color-background-secondary: #252E30;
  --color-brand-primary: #F3F3F3;
  --color-brand-content: #FFFFFF;
  --color-brand-visited: #FFFFFF;
  --color-background-border: #494e50;
  
      }
    }
  }
</style></head>
  <body>
    
    <script>
      document.body.dataset.theme = localStorage.getItem("theme") || "auto";
    </script>
    

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  <symbol id="svg-toc" viewBox="0 0 24 24">
    <title>Contents</title>
    <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
      <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
    </svg>
  </symbol>
  <symbol id="svg-menu" viewBox="0 0 24 24">
    <title>Menu</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
      <line x1="3" y1="12" x2="21" y2="12"></line>
      <line x1="3" y1="6" x2="21" y2="6"></line>
      <line x1="3" y1="18" x2="21" y2="18"></line>
    </svg>
  </symbol>
  <symbol id="svg-arrow-right" viewBox="0 0 24 24">
    <title>Expand</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
      <polyline points="9 18 15 12 9 6"></polyline>
    </svg>
  </symbol>
  <symbol id="svg-sun" viewBox="0 0 24 24">
    <title>Light mode</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
      <circle cx="12" cy="12" r="5"></circle>
      <line x1="12" y1="1" x2="12" y2="3"></line>
      <line x1="12" y1="21" x2="12" y2="23"></line>
      <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
      <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
      <line x1="1" y1="12" x2="3" y2="12"></line>
      <line x1="21" y1="12" x2="23" y2="12"></line>
      <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
      <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
    </svg>
  </symbol>
  <symbol id="svg-moon" viewBox="0 0 24 24">
    <title>Dark mode</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
      <path stroke="none" d="M0 0h24v24H0z" fill="none" />
      <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
    </svg>
  </symbol>
  <symbol id="svg-sun-with-moon" viewBox="0 0 24 24">
    <title>Auto light/dark, in light mode</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
      class="icon-custom-derived-from-feather-sun-and-tabler-moon">
      <path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/>
      <line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/>
      <line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/>
      <line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/>
      <line x1="19" y1="14.05" x2="20.414" y2="15.464"/>
      <line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/>
      <line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/>
      <line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/>
      <line x1="19" y1="5.05" x2="20.414" y2="3.636"/>
      <circle cx="14.5" cy="9.55" r="3.6"/>
    </svg>
  </symbol>
  <symbol id="svg-moon-with-sun" viewBox="0 0 24 24">
    <title>Auto light/dark, in dark mode</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
      class="icon-custom-derived-from-feather-sun-and-tabler-moon">
      <path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/>
      <line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/>
      <line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/>
      <line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/>
      <line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/>
      <line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/>
      <line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/>
      <line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/>
      <line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/>
      <circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/>
    </svg>
  </symbol>
  <symbol id="svg-pencil" viewBox="0 0 24 24">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code">
      <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" />
      <path d="M13.5 6.5l4 4" />
      <path d="M20 21l2 -2l-2 -2" />
      <path d="M17 17l-2 2l2 2" />
    </svg>
  </symbol>
  <symbol id="svg-eye" viewBox="0 0 24 24">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code">
      <path stroke="none" d="M0 0h24v24H0z" fill="none" />
      <path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
      <path
        d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" />
      <path d="M20 21l2 -2l-2 -2" />
      <path d="M17 17l-2 2l2 2" />
    </svg>
  </symbol>
</svg>

<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation" aria-label="Toggle site navigation sidebar">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc" aria-label="Toggle table of contents sidebar">
<label class="overlay sidebar-overlay" for="__navigation"></label>
<label class="overlay toc-overlay" for="__toc"></label>

<a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>



<div class="page">
  <header class="mobile-header">
    <div class="header-left">
      <label class="nav-overlay-icon" for="__navigation">
        <span class="icon"><svg><use href="#svg-menu"></use></svg></span>
      </label>
    </div>
    <div class="header-center">
      <a href="index.html"><div class="brand">TreeSize</div></a>
    </div>
    <div class="header-right">
      <div class="theme-toggle-container theme-toggle-header">
        <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
          <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
          <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
          <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
          <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
        </button>
      </div>
      <label class="toc-overlay-icon toc-header-icon" for="__toc">
        <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
      </label>
    </div>
  </header>
  <aside class="sidebar-drawer">
    <div class="sidebar-container">
      
      <div class="sidebar-sticky"><div class="sidebar-brand" href="index.html">
  
  <a href="https://www.jam-software.com">
    <div class="sidebar-logo-container">
      <img class="sidebar-logo only-light" src="_static/JAM_Logo_Help_Dark.png" alt="Light Logo"/>
      <img class="sidebar-logo only-dark" src="_static/JAM_Logo_Help_Dark.png" alt="Dark Logo"/>
    </div>
  </a>
  
  <a href="index.html" style="text-decoration:none">
    <span class="sidebar-brand-text">TreeSize</span>
  </a>
  
</div><form class="sidebar-search-container" method="get" action="search.html" role="search">
  <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
  <input type="hidden" name="check_keywords" value="yes">
  <input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
  <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="overview.html">概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">安装</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">快速入门</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="using_treesize.html">使用TreeSize</a><input aria-label="Toggle navigation of 使用TreeSize" class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l2 has-children"><a class="reference internal" href="ribbonbar.html">Ribbon Bar</a><input aria-label="Toggle navigation of Ribbon Bar" class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="file_menu.html">应用程序菜单</a></li>
<li class="toctree-l3"><a class="reference internal" href="quicktoolbar.html">快速访问工具栏</a></li>
<li class="toctree-l3"><a class="reference internal" href="hometab.html">主页选项卡</a></li>
<li class="toctree-l3"><a class="reference internal" href="scan_tab.html">扫描选项卡</a></li>
<li class="toctree-l3"><a class="reference internal" href="tools_menu.html">工具菜单</a></li>
<li class="toctree-l3"><a class="reference internal" href="view_menu.html">视图菜单</a></li>
<li class="toctree-l3"><a class="reference internal" href="help_tab.html">帮助选项卡</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="scan_targets.html">扫描目标</a></li>
<li class="toctree-l2"><a class="reference internal" href="scantarget.html">选择扫描目标</a></li>
<li class="toctree-l2"><a class="reference internal" href="directorytree.html">目录树</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="treesize_views.html">TreeSize视图</a><input aria-label="Toggle navigation of TreeSize视图" class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" role="switch" type="checkbox"/><label for="toctree-checkbox-3"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="charts.html">图表</a></li>
<li class="toctree-l3"><a class="reference internal" href="details.html">详细信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="extensions.html">扩展</a></li>
<li class="toctree-l3"><a class="reference internal" href="users.html">用户</a></li>
<li class="toctree-l3"><a class="reference internal" href="fileages.html">文件的年龄</a></li>
<li class="toctree-l3"><a class="reference internal" href="top-files.html">顶级文件</a></li>
<li class="toctree-l3"><a class="reference internal" href="history.html">历史记录</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="drivepanel.html">驱动器列表</a></li>
<li class="toctree-l2"><a class="reference internal" href="snapshots.html">快照</a></li>
<li class="toctree-l2"><a class="reference internal" href="disk_usage_comparison.html">磁盘使用情况比较</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="sharepoint.html">扫描 SharePoint</a><input aria-label="Toggle navigation of 扫描 SharePoint" class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" role="switch" type="checkbox"/><label for="toctree-checkbox-4"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3 has-children"><a class="reference internal" href="azure-ad-configuration.html">Azure AD 配置</a><input aria-label="Toggle navigation of Azure AD 配置" class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" role="switch" type="checkbox"/><label for="toctree-checkbox-5"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l4"><a class="reference internal" href="certificatebased-auth.html">基于证书的身份验证</a></li>
<li class="toctree-l4"><a class="reference internal" href="userbased-auth.html">基于用户的身份验证</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="options_dialog.html">选项</a><input aria-label="Toggle navigation of 选项" class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" role="switch" type="checkbox"/><label for="toctree-checkbox-6"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="optionsdialog-viewtab.html">显示</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsviewdirectorytree.html">目录树</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsdialog-file_groups.html">文件组</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsdialog-fileages.html">文件的年龄</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsdialog-charts.html">图表</a></li>
<li class="toctree-l3"><a class="reference internal" href="options-topfiles.html">顶级文件</a></li>
<li class="toctree-l3"><a class="reference internal" href="scan_options.html">常规扫描选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsdialog-includeexclu.html">扫描过滤器</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexportprinter.html">打印机</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexportpdf.html">PDF</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexportexcel.html">Excel</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexporthtml.html">超文本标记语言</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexportcsv.html">CSV</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexportxml.html">XML</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexportsqlite.html">SQLite</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexporttext.html">文本</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsexportemail.html">电子邮件</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsdialog-startup.html">应用程序启动</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionssystemcontextmenu.html">上下文菜单</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="file-search.html">使用文件搜索</a><input aria-label="Toggle navigation of 使用文件搜索" class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" role="switch" type="checkbox"/><label for="toctree-checkbox-7"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l2"><a class="reference internal" href="file_search_main_menu.html">文件搜索 Ribbon 栏</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_search_searchpaths.html">搜索路径</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="basicsearch.html">基本搜索</a><input aria-label="Toggle navigation of 基本搜索" class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" role="switch" type="checkbox"/><label for="toctree-checkbox-8"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="searchsyntax.html">搜索语法</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="duplicate_file_search.html">重复文件搜索</a><input aria-label="Toggle navigation of 重复文件搜索" class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" role="switch" type="checkbox"/><label for="toctree-checkbox-9"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="example_duplicatesearch.html">重复搜索是如何工作的?</a></li>
<li class="toctree-l3"><a class="reference internal" href="deduplication.html">去重是如何工作的?</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="custom_file_search.html">高级搜索</a><input aria-label="Toggle navigation of 高级搜索" class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" role="switch" type="checkbox"/><label for="toctree-checkbox-10"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="searchfilter_definition.html">如何定义搜索过滤器?</a></li>
<li class="toctree-l3"><a class="reference internal" href="availablefiltertypes.html">可用哪些类型的过滤器?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="filesearch_templates.html">文件搜索模板</a></li>
<li class="toctree-l2"><a class="reference internal" href="howtoexcludefiles.html">如何排除文件</a></li>
<li class="toctree-l2"><a class="reference internal" href="process_search_results.html">处理搜索结果</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="move_checked_files.html">移动选中的文件</a><input aria-label="Toggle navigation of 移动选中的文件" class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" role="switch" type="checkbox"/><label for="toctree-checkbox-11"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="unicode_zip_files.html">Unicode ZIP文件</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="renamedialog.html">批量重命名文件</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="searchoptions.html">搜索选项</a><input aria-label="Toggle navigation of 搜索选项" class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" role="switch" type="checkbox"/><label for="toctree-checkbox-12"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="generaloptionsfilesearch.html">常规选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsfilesearchpersonalize.html">个性化</a></li>
<li class="toctree-l3"><a class="reference internal" href="optionsfilesearchother.html">其他</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1 current has-children"><a class="reference internal" href="schedule_treesize_tasks.html">使用计划任务</a><input aria-label="Toggle navigation of 使用计划任务" checked="" class="toctree-checkbox" id="toctree-checkbox-13" name="toctree-checkbox-13" role="switch" type="checkbox"/><label for="toctree-checkbox-13"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul class="current">
<li class="toctree-l2 has-children"><a class="reference internal" href="schedule_scans.html">调度扫描</a><input aria-label="Toggle navigation of 调度扫描" class="toctree-checkbox" id="toctree-checkbox-14" name="toctree-checkbox-14" role="switch" type="checkbox"/><label for="toctree-checkbox-14"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="scheduler_options_tab.html">选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="scheduler_export_tab.html">导出</a></li>
<li class="toctree-l3"><a class="reference internal" href="scheduler_move_operation_tab.html">文件操作</a></li>
<li class="toctree-l3"><a class="reference internal" href="scheduler_advanced_tab.html">高级选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="scheduler_commandline_tab.html">命令行</a></li>
<li class="toctree-l3"><a class="reference internal" href="scheduler_schedule_tab.html">调度</a></li>
<li class="toctree-l3"><a class="reference internal" href="scheduler_all_task_tab.html">所有任务</a></li>
</ul>
</li>
<li class="toctree-l2 current current-page"><a class="current reference internal" href="#">命令行选项</a></li>
<li class="toctree-l2"><a class="reference internal" href="example_schedule_filesearch.html">如何安排文件搜索</a></li>
<li class="toctree-l2"><a class="reference internal" href="howtoschedulemove.html">如何安排移动或删除操作</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="tips___annotations.html">提示与注释</a><input aria-label="Toggle navigation of 提示与注释" class="toctree-checkbox" id="toctree-checkbox-15" name="toctree-checkbox-15" role="switch" type="checkbox"/><label for="toctree-checkbox-15"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l2"><a class="reference internal" href="notesonntfs.html">关于 NTFS 的说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="wasted_space.html">浪费空间</a></li>
<li class="toctree-l2"><a class="reference internal" href="regular_expressions.html">正则表达式</a></li>
<li class="toctree-l2"><a class="reference internal" href="translations.html">翻译</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="copyrightcontact.html">版权与联系方式</a></li>
</ul>

</div>
</div>

      </div>
      
    </div>
  </aside>
  <div class="main">
    <div class="content">
      <div class="article-container">
        <a href="#" class="back-to-top muted-link">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
            <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
          </svg>
          <span>Back to top</span>
        </a>
        <div class="content-icon-container">
          <div class="theme-toggle-container theme-toggle-content">
            <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
              <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
              <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
              <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
              <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
            </button>
          </div>
          <label class="toc-overlay-icon toc-content-icon" for="__toc">
            <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
          </label>
        </div>
        <article role="main" id="furo-main-content">
          <section id="command-line-options">
<span id="command-line-opt"></span><h1>命令行选项<a class="headerlink" href="#command-line-options" title="Link to this heading">¶</a></h1>
<p>Professional 版的 TreeSize 接受命令行选项,使您可以运行计划扫描或在第二天早上在显示器上显示扫描结果。</p>
<p><a class="reference internal" href="schedule_scans.html#scheduling-scans"><span class="std std-ref">调度扫描</span></a> 的对话框将帮助您编写包含以下选项的命令行。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>这些选项仅在 <a class="reference external" href="https://www.jam-software.com/treesize/editions.shtml">TreeSize Professional Edition</a> 中可用。</p>
</div>
<section id="all-options">
<h2>所有选项<a class="headerlink" href="#all-options" title="Link to this heading">¶</a></h2>
<div class="highlight-batch notranslate"><div class="highlight"><pre><span></span>Treesize.exe [/OPTION] SCANPATH
</pre></div>
</div>
<section id="or-help">
<h3>/或  /HELP<a class="headerlink" href="#or-help" title="Link to this heading">¶</a></h3>
<p>显示此帮助页面。</p>
</section>
<section id="ageoffiles">
<h3>/AGEOFFILES<a class="headerlink" href="#ageoffiles" title="Link to this heading">¶</a></h3>
<p>将扫描目录的“文件年龄”选项卡上的图形保存为位图、GIF、PNG、JPEG、文本或CSV文件。文件类型取决于指定文件名的扩展名。以下示例为本地驱动器C:创建“文件年龄”图形的JPEG图像文件:</p>
<div class="highlight-batch notranslate"><div class="highlight"><pre><span></span>Treesize /SCAN <span class="s2">&quot;C:\&quot;</span> /AGEOFFILES <span class="s2">&quot;C:\Documents\c_file_ages.jpg&quot;</span>
</pre></div>
</div>
</section>
<section id="appendtofiles-value">
<h3>/APPENDTOFILES &lt;值<a class="headerlink" href="#appendtofiles-value" title="Link to this heading">¶</a></h3>
<p>使用此选项,您可以选择 TreeSize 在导出时是否应将其输出附加到现有文件,例如在使用 /TEXT 时。选择 &quot;True&quot;可以追加,如果要覆盖现有文件,则选择 &quot;False&quot;。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>该参数不适用于导出的图像、XML 和 PDF 文件。这些文件总是会被覆盖。您可以使用开关 /DATE 来确保所有生成的报表都有唯一的文件名。</p>
</div>
<p>通过 /EXCEL 导出到 Excel 文件时,该参数可与 /SHEETNAME 一起使用,将数据追加到指定工作表。示例:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /APPENDTOFILES True /EXCEL &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Export</span><span class="o">.</span><span class="n">xlsx</span><span class="s2">&quot; /SHEETNAME &quot;</span><span class="n">test</span><span class="s2">&quot;</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /APPENDTOFILES False /TEXT &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Export</span><span class="o">.</span><span class="n">csv</span><span class="s2">&quot;</span>
</pre></div>
</div>
</section>
<section id="archivebitfilesonly">
<h3>/ARCHIVEBITFILESONLY<a class="headerlink" href="#archivebitfilesonly" title="Link to this heading">¶</a></h3>
<p>此选项仅包括在扫描中设置了存档位的文件。如果您想计算备份的大小,此选项非常有用。在这种情况下,您可以在桌面或开始菜单上创建一个快捷方式,自动开始计算备份的大小。示例:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">ARCHIVEBITFILESONLY</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;</span><span class="se">\\</span><span class="s2">Server\Backup\This&quot;</span>
</pre></div>
</div>
</section>
<section id="attach">
<h3>/ATTACH<a class="headerlink" href="#attach" title="Link to this heading">¶</a></h3>
<p>如果指定,所有导出的文件将附加到电子邮件中。如果未指定,具有明确给定路径的文件将不附加。这在您的XML或Excel文件变得相当大并占满您的电子邮件帐户时非常有用。</p>
<p>此示例将导出到Excel文件,但不会将其附加到邮件中:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></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">&quot;F:</span><span class="se">\&quot;</span><span class="s2"> /EMAIL &quot;</span><span class="n">treesize</span><span class="nd">@example</span><span class="o">.</span><span class="n">com</span><span class="s2">&quot; /EXCEL &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Temp</span>\<span class="n">test</span><span class="o">.</span><span class="n">xlsx</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>这些示例将Excel文件附加到电子邮件中:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></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">&quot;F:</span><span class="se">\&quot;</span><span class="s2"> /EMAIL &quot;</span><span class="n">treesize</span><span class="nd">@example</span><span class="o">.</span><span class="n">com</span><span class="s2">&quot; /EXCEL</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">&quot;F:</span><span class="se">\&quot;</span><span class="s2"> /EMAIL &quot;</span><span class="n">treesize</span><span class="nd">@example</span><span class="o">.</span><span class="n">com</span><span class="s2">&quot; /ATTACH /EXCEL &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Temp</span>\<span class="n">test</span><span class="o">.</span><span class="n">xlsx</span><span class="s2">&quot;</span>
</pre></div>
</div>
</section>
<section id="barchart-filename">
<h3>/BARCHART &lt;文件名<a class="headerlink" href="#barchart-filename" title="Link to this heading">¶</a></h3>
<p>将扫描目录的条形图保存为位图、GIF、PNG或JPEG文件。文件类型取决于指定文件名的扩展名。此示例为本地驱动器C:创建条形图的PNG图像文件:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /BARCHART &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Documents</span>\<span class="n">c</span><span class="o">.</span><span class="n">png</span><span class="s2">&quot;</span>
</pre></div>
</div>
</section>
<section id="compare-filename-path">
<h3>/COMPARE &lt;文件名|路径<a class="headerlink" href="#compare-filename-path" title="Link to this heading">¶</a></h3>
<p>将扫描的路径与保存的索引文件进行比较。以下示例扫描驱动器C:并将结果与该驱动器的保存XML报告进行比较:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">COMPARE</span> <span class="s2">&quot;C:\Reports\TreeSize\c.xml.zip&quot;</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;C:</span><span class="se">\&quot;</span>
</pre></div>
</div>
<p>您也可以通过此命令行参数使用一个路径来代替索引文件。给定路径将与当前扫描结果进行比较。下面的示例扫描驱动器 C:\,并额外使用路径 D:Backup_of_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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /COMPARE &quot;</span><span class="n">D</span><span class="p">:</span>\<span class="n">Backup_of_C</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>您可以通过使用以下命令比较两个已存在的索引文件,例如 &quot;c1.xml.zip&quot; 和 &quot;c2.xml.zip&quot;:</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">&quot;C:\Reports\TreeSize\c1.xml.zip&quot;</span> <span class="o">/</span><span class="n">COMPARE</span> <span class="s2">&quot;C:\Reports\TreeSize\c2.xml.zip&quot;</span>
</pre></div>
</div>
<p>/OPEN 命令将第一个文件(&quot;c1.xml.zip&quot;)扩展为扫描文件,为两个文件的比较做准备。第二个文件(&quot;c2.xml.zip&quot;)将与扩展后的扫描文件进行比较,就像将 &quot;c2.xml.zip &quot;与 &quot;真实 &quot;扫描文件进行比较一样。</p>
</section>
<section id="copy-path">
<h3>/COPY &lt;路径<a class="headerlink" href="#copy-path" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>将 TreeSize 文件搜索的结果复制到目标位置。</p>
<p>以下命令将使用最新的搜索选项在本地驱动器 C: 上进行搜索,并将搜索结果复制到 &quot;C:\temp\ObsoleteFiles &quot;文件夹:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /COPY &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">temp</span>\<span class="n">ObsoleteFiles</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>另请参见: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">移动选中的文件</span></a></p>
</section>
<section id="createdpastdaysonly-n">
<h3>/CREATEDPASTDAYSONLY &lt;n&gt;<a class="headerlink" href="#createdpastdaysonly-n" title="Link to this heading">¶</a></h3>
<p>此选项将仅包括在参数中输入的天数内创建的文件。在以下示例中,此选项将仅包括在过去八天内创建的文件:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">CREATEDPASTDAYSONLY</span> <span class="mi">8</span>
</pre></div>
</div>
</section>
<section id="createsnapshot-drive">
<h3>/CREATESNAPSHOT &lt;驱动器<a class="headerlink" href="#createsnapshot-drive" title="Link to this heading">¶</a></h3>
<p>为该命令行参数后面给出的驱动器创建快照。示例</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">CREATESNAPSHOT</span> <span class="s2">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> &quot;</span><span class="n">D</span><span class="p">:</span>\<span class="s2">&quot;</span>
</pre></div>
</div>
<p>创建快照可能需要管理员权限。</p>
</section>
<section id="csv-filename">
<h3>/CSV &lt;文件名<a class="headerlink" href="#csv-filename" title="Link to this heading">¶</a></h3>
<p>在扫描或搜索完成后将结果保存到 CSV 文件中。应用程序将在保存后自行终止。此示例将在您的本地驱动器 C: 上使用最后的搜索配置将文件搜索的结果保存到 CSV 文件中:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /CSV &quot;</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">csv</span><span class="s2">&quot;</span>
</pre></div>
</div>
</section>
<section id="date">
<h3>/DATE<a class="headerlink" href="#date" title="Link to this heading">¶</a></h3>
<p>此开关将在命令行中的所有导出文件名中添加当前日期和时间。如果你想定期进行扫描,例如每晚或每周末,这个功能就很有用。下面的示例将扫描网络路径&quot;\\Host\Share&quot;,并将结果保存到类似 &quot;C:Scansname_2013-08-14_17-18-24.xls &quot;的文件中:</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">&quot;</span><span class="se">\\</span><span class="s2">Host\Share&quot;</span> <span class="o">/</span><span class="n">DATE</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;C:\Scans</span><span class="se">\n</span><span class="s2">ame.xls&quot;</span>
</pre></div>
</div>
</section>
<section id="deduplicate">
<h3>/DEDUPLICATE<a class="headerlink" href="#deduplicate" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>它将用 NTFS 硬链接替换 TreeSize 重复文件搜索中找到的重复文件:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /DEDUPLICATE</span>
</pre></div>
</div>
</section>
<section id="delete">
<h3>/DELETE<a class="headerlink" href="#delete" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>永久删除所有作为 TreeSize 文件搜索结果找到的文件。示例:</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">&quot;C:</span><span class="se">\t</span><span class="s2">emp&quot;</span> <span class="o">/</span><span class="n">FILTER</span> <span class="s2">&quot;*.tmp&quot;</span> <span class="o">/</span><span class="n">DELETE</span>
</pre></div>
</div>
<p>另请参见: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">移动选中的文件</span></a></p>
</section>
<section id="email-recipient">
<h3>/EMAIL &lt;收件人<a class="headerlink" href="#email-recipient" title="Link to this heading">¶</a></h3>
<p>将收集到的数据发送到指定的电子邮件地址。此参数只能在命令行中使用一次,并且只会发送一封包含所有结果的电子邮件。多个收件人可以用分号(;)或逗号分隔。要通过命令行发送电子邮件,您需要在TreeSize选项对话框的相应页面上指定有效的SMTP设置。示例:</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">&quot;</span><span class="se">\\</span><span class="s2">Server\Share&quot;</span> <span class="o">/</span><span class="n">EMAIL</span> <span class="s2">&quot;treesize@example.com&quot;</span>
</pre></div>
</div>
<p>如果未指定其他参数,电子邮件将以选项中设置的格式发送(HTML或纯文本)。如果您希望独立于当前选项定义格式,可以在收件人地址定义后直接使用参数/TEXT或/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">&quot;</span><span class="se">\\</span><span class="s2">Server\Share&quot;</span> <span class="o">/</span><span class="n">EMAIL</span> <span class="s2">&quot;treesize@example.com&quot;</span> <span class="o">/</span><span class="n">TEXT</span>
</pre></div>
</div>
<p>通过组合参数,您还可以向电子邮件添加附件。以下示例将扫描的Excel报告作为附件添加到电子邮件中:</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">&quot;</span><span class="se">\\</span><span class="s2">Server\Share&quot;</span> <span class="o">/</span><span class="n">EMAIL</span> <span class="s2">&quot;treesize@example.com&quot;</span> <span class="o">/</span><span class="n">EXCEL</span>
</pre></div>
</div>
</section>
<section id="emailifresultsfound">
<h3>/EMAILIFRESULTSFOUND<a class="headerlink" href="#emailifresultsfound" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 和 /EMAIL 结合使用。如果指定了该参数,TreeSize 只有在搜索过程中通过任何指定的搜索类型找到至少一个文件或文件夹时,才会发送包含当前搜索结果的电子邮件。</p>
</section>
<section id="emptyrecyclebin">
<h3>/EMPTYRECYCLEBIN<a class="headerlink" href="#emptyrecyclebin" title="Link to this heading">¶</a></h3>
<p>如果使用此选项,TreeSize将在运行当前扫描之前清空回收站。示例:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Treesize</span> <span class="o">/</span><span class="n">EMPTYRECYCLEBIN</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;C:</span><span class="se">\&quot;</span>
</pre></div>
</div>
</section>
<section id="execute-filename">
<h3>/EXECUTE <filename><a class="headerlink" href="#execute-filename" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>此参数允许将 TreeSize 文件搜索找到的文件传递给其他应用程序或脚本。该参数的可能目标可以是批处理或 powershell 脚本。下面的示例将使用最新的搜索设置搜索驱动器 C:\,并为找到的每个文件调用脚本 &quot;Archive.bat&quot;。文件将作为命令行参数传递给脚本:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /EXECUTE &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Scripts</span>\<span class="n">Archive</span><span class="o">.</span><span class="n">bat</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>另请参见: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">移动选中的文件</span></a></p>
</section>
<section id="excel-filepath">
<h3>/EXCEL &lt;文件路径<a class="headerlink" href="#excel-filepath" title="Link to this heading">¶</a></h3>
<p>以Microsoft Excel格式导出收集到的数据,并将其保存在输入的文件路径下。如果仅指定文件名,则使用当前安装目录来存储导出。支持的格式包括传统的.XLS文件格式(Excel 97-2003)以及.XLSX格式(Excel 2007引入)。所使用的格式取决于指定文件名的扩展名。应用程序将在保存后自行终止。示例:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /EXCEL &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Documents</span>\<span class="n">c</span><span class="o">.</span><span class="n">xls</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>如果文件名已存在,文件将被打开并添加一个新的工作表。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>在 TreeSize File Search (/SEARCH) 中,每种搜索类型的结果都收集在各自特定的工作表中。如果给定路径下的文件已经存在,这些工作表将被覆盖。要避免这种情况,需要使用命令行选项 /APPENDTOFILES 。</p>
</div>
</section>
<section id="exclude-pattern1-pattern2">
<h3>/EXCLUDE &lt;pattern1;pattern2&gt;<a class="headerlink" href="#exclude-pattern1-pattern2" title="Link to this heading">¶</a></h3>
<p>此选项使您能够指定应从扫描中排除的文件和文件夹的模式。多个排除模式可以用分号(;)分隔。如果一个或多个模式包含空格,则完整的模式字符串必须用引号(&quot;)括起来。以下示例将忽略以“.tmp”结尾的文件和文件夹或名称完全为“system”的文件和文件夹:</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">&quot;</span><span class="se">\\</span><span class="s2">Server\Users&quot;</span> <span class="o">/</span><span class="n">EXCLUDE</span> <span class="s2">&quot;*.tmp;system&quot;</span>
</pre></div>
</div>
</section>
<section id="expand-level-size">
<h3>/EXPAND &lt;级别|大小<a class="headerlink" href="#expand-level-size" title="Link to this heading">¶</a></h3>
<p>通过该选项可以指定扫描后将展开目录树的多少层。如果在该选项后不指定数字,则会展开所有文件夹。您也可以指定一个以百万字节(MB)为单位的数量来代替目录层级。在这种情况下,所有大于给定数量的文件夹都将被展开。单位 &quot;MB &quot;必须跟在数字后面,不能有空格。下面的示例将扫描文件夹 &quot;H:\User&quot;,展开所有大于 10 MB 的文件夹,并将结果保存到 Excel 文件 &quot;C:\Resultsallusers.xlsx &quot;中:</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">&quot;H:\User&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;C:\Results\Allusers.xlsx&quot;</span> <span class="o">/</span><span class="n">EXPAND</span> <span class="mi">10</span><span class="n">MB</span>
</pre></div>
</div>
</section>
<section id="expandablereport-value">
<h3>/EXPANDABLEREPORT &lt;值<a class="headerlink" href="#expandablereport-value" title="Link to this heading">¶</a></h3>
<p>如果使用此选项,Excel导出将使用可展开/折叠的组,可以类似于目录树进行导航。</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">&quot;H:\User&quot;</span> <span class="o">/</span><span class="n">EXPANDABLEREPORT</span> <span class="kc">True</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;C:\Results\Allusers.xlsx&quot;</span>

<span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;H:\User&quot;</span> <span class="o">/</span><span class="n">EXPANDABLEREPORT</span> <span class="kc">False</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;C:\Results\Allusers.xlsx&quot;</span>
</pre></div>
</div>
</section>
<section id="exportdriveslist-filename">
<h3>/EXPORTDRIVESLIST &lt;文件名<a class="headerlink" href="#exportdriveslist-filename" title="Link to this heading">¶</a></h3>
<p>此选项允许您将“驱动器列表”的内容导出到 Excel、文本或 CSV 文件。文件类型取决于指定文件名的扩展名。示例:</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">&quot;C:\Results\AllDrives.csv&quot;</span> <span class="o">/</span><span class="n">EXPORTDRIVESLIST</span>
</pre></div>
</div>
</section>
<section id="exportfiles">
<h3>/EXPORTFILES<a class="headerlink" href="#exportfiles" title="Link to this heading">¶</a></h3>
<p>如果指定,文件将包含在所有导出中。因此,此选项相当于激活“工具 &gt; 选项 &gt; 导出 &gt; * &gt; 导出元素 &gt; 文件夹和单个文件”选项。</p>
</section>
<section id="exportgroupsexpanded">
<h3>/EXPORTGROUPSEXPANDED<a class="headerlink" href="#exportgroupsexpanded" title="Link to this heading">¶</a></h3>
<p>如果指定,扩展列表的导出将包含有关组内包含的扩展的所有信息。</p>
</section>
<section id="exportpathslist-filename">
<h3>/EXPORTPATHSLIST &lt;文件名<a class="headerlink" href="#exportpathslist-filename" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>导出一个简单列表,包含所有搜索结果。该列表将仅包含搜索结果的完整路径,而不包含其他信息。支持的目标文件格式为 .txt 和 .csv。</p>
<p>此示例将在 C 盘上搜索并创建所有 exe 文件的列表:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /FILTER &quot;</span><span class="o">*.</span><span class="n">exe</span><span class="s2">&quot; /EXPORTPATHSLIST &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Results</span>\<span class="n">SearchResults</span><span class="o">.</span><span class="n">csv</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>它可以用于通过“文件 &gt; 路径列表 &gt; 导入路径列表”或参数 /IMPORT 将先前搜索的结果导入回用户界面。</p>
<p>如果激活了“工具 &gt; 选项 &gt; 导出 &gt; 包含重复组”选项,您还可以使用此功能导出和导入包括其组结构的重复搜索结果。</p>
</section>
<section id="exporttitle-title">
<h3>/EXPORTTITLE <title><a class="headerlink" href="#exporttitle-title" title="Link to this heading">¶</a></h3>
<p>可用于更改打印报告或导出文件中的标题。这使您能够在自动化环境中使用 TreeSize 时向用户提供附加信息。也允许使用环境变量。示例:</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">&quot;</span><span class="se">\\</span><span class="s2">Server3\C$&quot;</span> <span class="o">/</span><span class="n">EXPORTTITLE</span> <span class="s2">&quot;This is drive C on Server3&quot;</span> <span class="o">/</span><span class="n">PRINT</span>
</pre></div>
</div>
</section>
<section id="extensionslist-filename">
<h3>/EXTENSIONSLIST &lt;文件名<a class="headerlink" href="#extensionslist-filename" title="Link to this heading">¶</a></h3>
<p>此选项允许您将扫描的文件系统分支的文件扩展名/文件类型统计信息保存到 Excel、HTML、文本或 CSV 文件中。文件类型取决于指定文件名的扩展名。导出的列将是上次在“扩展”选项卡中启用的列,或在通过 /OPTIONS 提供的配置文件写入时的列。</p>
<p>下面的示例扫描了驱动器 C:,并创建了名为 &quot;D:\TreeSize ReportsC_filetypes.xls&quot; 的 Excel 文件,其中包含该驱动器上文件类型的统计信息:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /EXTENSIONSLIST &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="extensionschart-filename">
<h3>/EXTENSIONSCHART &lt;文件名<a class="headerlink" href="#extensionschart-filename" title="Link to this heading">¶</a></h3>
<p>将“扩展”页面底部显示的小图表保存为图像文件(位图、GIF、PNG 或 JPEG)。</p>
</section>
<section id="extensionspiechart-filename">
<h3>/EXTENSIONSPIECHART &lt;文件名<a class="headerlink" href="#extensionspiechart-filename" title="Link to this heading">¶</a></h3>
<p>将显示“文件扩展名”分布的饼图保存为图像文件(位图、GIF、PNG 或 JPEG)。</p>
</section>
<section id="filter-pattern1-pattern2">
<h3>/FILTER &lt;pattern1;pattern2&gt;<a class="headerlink" href="#filter-pattern1-pattern2" title="Link to this heading">¶</a></h3>
<p>设置文件过滤器,仅计算具有特定扩展名的文件,例如 &quot;.mp3&quot; 或 &quot;.doc&quot;。可以传递多个模式,以分号 (;) 分隔。以下示例将在服务器的 &quot;Users&quot; 目录中搜索 MP3 和 AVI 文件:</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">&quot;</span><span class="se">\\</span><span class="s2">Server\Users&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;C:\Results\UsersMediaFiles.xlsx&quot;</span> <span class="o">/</span><span class="n">FILTER</span> <span class="s2">&quot;*.mp3;*.avi&quot;</span>
</pre></div>
</div>
<p>执行 TreeSize 文件搜索 (/SEARCH) 时,还可以使用 /FILTER 命令行开关来指定高级文件搜索的模式。要执行更复杂的自定义文件搜索,应将搜索选项保存到文件中,并在 /SEARCH 后将生成的 XML 文件传递到命令行。</p>
</section>
<section id="followreparsepoints">
<h3>/FOLLOWREPARSEPOINTS<a class="headerlink" href="#followreparsepoints" title="Link to this heading">¶</a></h3>
<p>如果将此开关添加到命令行,TreeSize 将在扫描文件系统树时跟随挂载点和外部符号链接。</p>
</section>
<section id="groupscans">
<h3>/GROUPSCANS<a class="headerlink" href="#groupscans" title="Link to this heading">¶</a></h3>
<p>使用此命令行开关将把所有扫描目录归入一个虚拟根文件夹。如果要确保不使用虚拟根文件夹,请使用 /GROUPSCANS FALSE 。</p>
</section>
<section id="hidesmallfolders-value">
<h3>/HIDESMALLFOLDERS &lt;值<a class="headerlink" href="#hidesmallfolders-value" title="Link to this heading">¶</a></h3>
<p>允许隐藏小于最小尺寸的对象,这对获得清晰的导出非常有用。 &lt;value&gt; 可以是带单位的尺寸值,也可以是不带单位的普通字节值。不能与 /EXPAND 结合使用。在本示例中,只导出最小大小为 50MB 的文件夹:</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">&quot;C:\Results\DriveC.xlsx&quot;</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 &lt;文件名<a class="headerlink" href="#historychart-filename" title="Link to this heading">¶</a></h3>
<p>将扫描目录的 &quot;历史&quot; 选项卡上的图表保存为位图、GIF、PNG 或 JPEG 文件。文件类型取决于指定文件名的扩展名。此示例为驱动器 C 创建历史图表的 JPEG 图像:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /HISTORYCHART &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="html-filename">
<h3>/HTML &lt;文件名<a class="headerlink" href="#html-filename" title="Link to this heading">¶</a></h3>
<p>将收集的数据保存为 HTML 文件,可以使用任何 HTML 浏览器查看。您可以通过 &quot;主页 &gt; 选项 &gt; 导出 &gt; HTML &gt; 包含的图表和列表&quot; 指定扫描中将包含哪些信息。您可以选择要添加到导出的附加列表或图表。它们将自动嵌入到扫描后生成的 HTML 文件中。</p>
<p>下面的示例将为驱动器 C: 生成 HTML 报表,并将其保存到 &quot;D:\HTML&quot;:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /HTML &quot;</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">&quot;</span>
</pre></div>
</div>
<p>如果希望 HTML 文件中包含某些扫描结果,则应添加命令行开关 /GROUPSCANS 。导出 HTML 文件时,如果不包含图像,也可以使用开关 /APPENDTOFILES.Without one of these flags, the HTML file will get overwitten.没有这些标志,HTML 文件将被覆盖。</p>
</section>
<section id="import-filename">
<h3>/IMPORT &lt;文件名<a class="headerlink" href="#import-filename" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>将路径列表加载到 TreeSize 文件搜索的用户界面中。文件可以是 .txt 或 .csv 格式。此参数可用于导入先前搜索的结果。导入的文件和文件夹可以像任何 &quot;实时&quot; 搜索结果一样使用文件操作对话框进行移动/复制/删除/归档。</p>
<p>示例:</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">&quot;C:\Results</span><span class="se">\f</span><span class="s2">ilelist.txt&quot;</span>
</pre></div>
</div>
<p>还可以将此参数与 /RECYCLE 、/DELETE 或 /MOVE 参数结合使用,自动删除或移动文本文件中包含的文件。示例:</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">&quot;C:\Results</span><span class="se">\f</span><span class="s2">ilesToDelete.csv&quot;</span> <span class="o">/</span><span class="n">RECYCLE</span>
</pre></div>
</div>
</section>
<section id="importpatterns-filename">
<h3>/IMPORTPATTERNS &lt;文件名<a class="headerlink" href="#importpatterns-filename" title="Link to this heading">¶</a></h3>
<p>从文件导入模式列表。该文件可以是一个简单的文本文件,包含以分号分隔的过滤模式列表,或者您可以使用用户界面创建更复杂的模式集,并使用导出功能生成XML格式的模式文件。支持的格式有CSV、TXT和XML。</p>
<p>导入的模式将用作扫描的过滤器,以包含或排除特定的文件和文件夹。</p>
<p>如果与命令行选项 /SEARCH 结合使用,该参数将创建一个新的高级搜索,使用导入文件中的模式作为搜索条件。</p>
<p>此示例将导出在 &quot;C:TreeSizeFiles\patterns.txt &quot;下定义的筛选模式,开始扫描驱动器 C:\,并将结果导出为 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">IMPORTPATTERNS</span> <span class="s2">&quot;C:\TreeSizeFiles\patterns.txt&quot;</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /HTML &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="indexfile-filename">
<h3>/INDEXFILE &lt;文件名<a class="headerlink" href="#indexfile-filename" title="Link to this heading">¶</a></h3>
<p>将扫描结果保存到SQLite文件中,以便在以后进行比较。示例:</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">&quot;H:\users</span><span class="se">\&quot;</span><span class="s2"> /INDEXFILE &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="listseparator-separator-char">
<h3>/LISTSEPARATOR &lt;分隔符字符<a class="headerlink" href="#listseparator-separator-char" title="Link to this heading">¶</a></h3>
<p>允许您定义导出文本或CSV文件时使用的分隔符。文本文件默认使用制表符,CSV文件使用Windows控制面板的区域设置中的列表分隔符。</p>
<p>请在此开关后指定一个单字符或字符串&quot;TAB&quot;以表示制表符。示例:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /LISTSEPARATOR ; /TEXT &quot;</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">&quot;</span>

<span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /LISTSEPARATOR TAB /TEXT &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="move-path">
<h3>/MOVE &lt;路径<a class="headerlink" href="#move-path" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>它将TreeSize文件搜索的结果移动到另一个位置。</p>
<p>以下命令将使用最新的搜索选项在本地驱动器 C: 上进行搜索,并将搜索结果移动到 &quot;C:\TempObsoleteFiles &quot;文件夹:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /SEARCH:Start /MOVE &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Temp</span>\<span class="n">ObsoleteFiles</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>另请参见: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">移动选中的文件</span></a></p>
</section>
<section id="nogui">
<h3>/NOGUI<a class="headerlink" href="#nogui" title="Link to this heading">¶</a></h3>
<p>将不显示窗口,应用程序也不会出现在任务栏中。适合在后台执行扫描或搜索,而无需视觉反馈。</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>仅在您测试了其余命令行选项后使用此开关,因为在此模式下无法显示错误消息。</p>
</div>
<p>但是,错误将记录在Windows事件日志中。</p>
</section>
<section id="noheaders">
<h3>/NOHEADERS<a class="headerlink" href="#noheaders" title="Link to this heading">¶</a></h3>
<p>省略通常写在扫描或搜索导出文件顶部的标题行。这使得接收用于后处理的纯数据更容易。</p>
</section>
<section id="nounits">
<h3>/NOUNITS<a class="headerlink" href="#nounits" title="Link to this heading">¶</a></h3>
<p>省略通常写在大小值后面的单位。该选项与 /SIZEUNIT 0 结合使用将导出纯字节值。这样可以更方便地接收纯数据进行后处理。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>该命令行只影响使用 /TEXT, /EXCEL, /HTML, /EMAIL 或 /PRINT 选项导出的目录树。/EXTENSIONSLIST, /USERSLIST 、/EXPORTDRIVESLIST 或 /TOPFILESLIST 将不受影响。</p>
</div>
</section>
<section id="open-filename">
<h3>/OPEN &lt;文件名<a class="headerlink" href="#open-filename" title="Link to this heading">¶</a></h3>
<p>在应用程序启动时打开保存的 XML 报告。示例:</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">&quot;C:\Reports\Drive_C.xml.zip&quot;</span>
</pre></div>
</div>
</section>
<section id="options-filename">
<h3>/OPTIONS &lt;文件名<a class="headerlink" href="#options-filename" title="Link to this heading">¶</a></h3>
<p>使用此参数将导出的用户设置应用于 TreeSize。用户设置可以在“文件 &gt; 选项 &gt; 导出”中导出。示例:</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">&quot;C:\Temp\User Settings.xml&quot;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>在保存选项之前,尽可能多地更改用户界面中的设置,以减少所需的命令行参数数量。</p>
</div>
</section>
<section id="pdf">
<h3>/PDF<a class="headerlink" href="#pdf" title="Link to this heading">¶</a></h3>
<p>在扫描或搜索完成后将结果保存为 PDF 文件。保存后,应用程序将自行终止。以下示例将扫描本地驱动器 C: 并将结果保存为 PDF 文件:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /PDF &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="piechart-filename">
<h3>/PIECHART &lt;文件名<a class="headerlink" href="#piechart-filename" title="Link to this heading">¶</a></h3>
<p>将扫描目录的饼图保存为位图、GIF、PNG 或 JPEG 文件。文件类型取决于指定文件名的扩展名。以下示例将扫描驱动器 C: 并以 PNG 格式导出饼图:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /PIECHART &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="print">
<h3>/PRINT<a class="headerlink" href="#print" title="Link to this heading">¶</a></h3>
<p>使用系统设置中配置的默认打印机打印扫描的目录树报告。打印后,应用程序将被终止。示例:</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">&quot;</span><span class="se">\\</span><span class="s2">SERVER\USERS&quot;</span> <span class="o">/</span><span class="n">PRINT</span>
</pre></div>
</div>
</section>
<section id="readonlymode-value">
<h3>/READONLYMODE &lt;值<a class="headerlink" href="#readonlymode-value" title="Link to this heading">¶</a></h3>
<p>如果值设置为 true,则此选项激活只读模式,在该模式下,文件操作(例如移动或删除)被禁用,因此它将仅用作报告工具。</p>
<p>以 false 的值开始以再次停用只读模式。</p>
</section>
<section id="recycle">
<h3>/RECYCLE<a class="headerlink" href="#recycle" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>将所有在 TreeSize 文件搜索中找到的文件移动到回收站。示例:</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">&quot;C:</span><span class="se">\t</span><span class="s2">emp&quot;</span> <span class="o">/</span><span class="n">FILTER</span> <span class="s2">&quot;*.tmp&quot;</span> <span class="o">/</span><span class="n">RECYCLE</span>
</pre></div>
</div>
<p>另请参见: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">移动选中的文件</span></a></p>
</section>
<section id="restrictedmode-value">
<h3>/RESTRICTEDMODE &lt;值<a class="headerlink" href="#restrictedmode-value" title="Link to this heading">¶</a></h3>
<p>如果值设置为 true,则此选项激活受限模式,在该模式下,许多对“普通”(非管理员)用户不感兴趣的功能被禁用。被禁用的功能包括:检查更新、打开 Windows 控制面板的软件小程序、安排 TreeSize 扫描、连接网络驱动器、配置 Windows 系统还原、以管理员身份运行、导出和应用 NTFS 压缩。您可以在命令行中或使用保存的配置文件中的启动路径提供应扫描的路径,例如用户的主目录。</p>
<p>以 false 的值开始以再次停用受限模式。</p>
<p>如果另外激活 /READONLYMODE 选项,用户将无法在 TreeSize 中删除或移动文件,因此它只能作为报表工具使用。</p>
</section>
<section id="scan-path-filename">
<h3>/SCAN &lt;路径|文件名<a class="headerlink" href="#scan-path-filename" title="Link to this heading">¶</a></h3>
<p>定义应扫描的驱动器或路径。扫描路径应作为此参数的值使用。</p>
<p>例如,如果要扫描驱动器 D:\,可以使用</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">&quot;D:</span><span class="se">\&quot;</span>
</pre></div>
</div>
<p>如果您不想扫描整个驱动器,也可以指定一个路径,该路径将作为扫描的起点。例如:</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">&quot;</span><span class="se">\\</span><span class="s2">Server\Share\MyDocuments&quot;</span>
</pre></div>
</div>
<p>多个扫描路径也是可能的,它们用空格分隔。包含空格的路径必须用引号(&quot;)括起来。示例:</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">&quot;C:\Program Files</span><span class="se">\&quot;</span><span class="s2"> &quot;</span><span class="n">C</span><span class="p">:</span>\<span class="n">Windows</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>允许使用通配符 &quot;*&quot; 和 &quot;?&quot;。示例:</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">&quot;H:\users\A*&quot;</span>
</pre></div>
</div>
<p>您也可以指定一个文本文件,其中包含应扫描的路径列表。TreeSize 会扫描在此开关后指定的文本文件中找到的所有路径。文本文件必须每行包含一个路径。下面的示例扫描了在文件 &quot;D:\PathsToScan.txt &quot;中找到的所有路径,并将每个扫描结果写入 Excel 文件中的单独工作表,并注明今天的日期:</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">&quot;D:\PathsToScan.txt&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;D:\Results\%DATE%.xlsx&quot;</span>
</pre></div>
</div>
<p>您还可以在 &quot;for&quot; 循环中调用 TreeSize,仅使用其中一个路径,以下是示例。</p>
</section>
<section id="search">
<h3>/SEARCH<a class="headerlink" href="#search" title="Link to this heading">¶</a></h3>
<p>打开 TreeSize 的文件搜索窗口。如果在此命令行选项中添加了 ":Start" ,搜索将自动启动。可以传递先前保存的包含搜索设置的 XML 文件,然后将使用这些设置执行搜索。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>在此搜索中找到的文件将自动被选中。</p>
</div>
<p>以下示例使用先前保存到文件 &quot;SearchSettings.xml&quot; 的设置执行搜索,并将结果保存到文本文件中:</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">&quot;SearchSettings.xml&quot;</span> <span class="o">/</span><span class="n">TEXT</span> <span class="s2">&quot;T:\SearchResult.txt&quot;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>一般情况下,将使用上次的搜索设置或以前保存的搜索设置。不过,也可以使用 /FILTER 命令行选项指定高级搜索的搜索模式。</p>
</div>
</section>
<section id="sheetname-title">
<h3>/SHEETNAME <title><a class="headerlink" href="#sheetname-title" title="Link to this heading">¶</a></h3>
<p>使用 /EXCEL 命令行开关时,可以指定将添加到 Excel 文件中的工作表名称。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Excel 工作表名称在 Excel 文件中必须是唯一的,并且某些特殊字符如斜杠、反斜杠和冒号是禁止的。TreeSize 将始终通过用下划线替换无效字符并在必要时添加日期和时间来创建唯一的工作表名称。如果目标文件中已存在指定名称的工作表,则会创建一个具有唯一名称的新工作表。使用命令行选项 /APPENDTOFILES 将数据附加到现有工作表。</p>
</div>
</section>
<section id="shortdateformat-format">
<h3>/SHORTDATEFORMAT &lt;格式<a class="headerlink" href="#shortdateformat-format" title="Link to this heading">¶</a></h3>
<p>更改此过程的短日期格式,该格式可以在 Windows 控制面板的区域选项中配置。TreeSize 的导出将使用此格式表示日期值。示例:</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">&quot;E:</span><span class="se">\&quot;</span><span class="s2"> /SHORTDATEFORMAT YYYY-MM-DD /TEXT &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="sizeunit-n">
<h3>/SIZEUNIT &lt;n&gt;<a class="headerlink" href="#sizeunit-n" title="Link to this heading">¶</a></h3>
<p>此选项可用于指定显示大小值时使用的单位:N 可以取值 0 到 5,分别表示:0 = 字节,1 = KB,2 = MB,3 = GB,4 = TB,5 = 自动单位。没有此选项时,将使用 TreeSize 中最后使用的配置。</p>
</section>
<section id="sortby-columnname">
<h3>/SORTBY &lt;列名<a class="headerlink" href="#sortby-columnname" title="Link to this heading">¶</a></h3>
<p>使您能够指定按哪个值对生成的导出内容进行排序的方式。可能的值是列名,如 &quot;Size&quot; 或 &quot;Name&quot;。默认使用 TreeSize 用户界面中最后使用的排序方式。示例</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">&quot;E:</span><span class="se">\&quot;</span><span class="s2"> /SORTBY Size /TEXT &quot;</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">&quot;</span>

<span class="n">Treesize</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;E:</span><span class="se">\&quot;</span><span class="s2"> /SORTBY Name /EXCEL &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="sqlite-filename">
<h3>/SQLITE &lt;文件名<a class="headerlink" href="#sqlite-filename" title="Link to this heading">¶</a></h3>
<p>将扫描结果保存到SQLite文件中,以便在以后进行比较。示例:</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">&quot;H:\users</span><span class="se">\&quot;</span><span class="s2"> /SQLITE &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="subject-subject">
<h3>/SUBJECT &lt;主题<a class="headerlink" href="#subject-subject" title="Link to this heading">¶</a></h3>
<p>此选项允许您自定义将在扫描结束时发送的电子邮件的主题。示例:</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">&quot;</span><span class="se">\\</span><span class="s2">Server\Share&quot;</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">&quot;TreeSize Professional Scan Report&quot;</span>
</pre></div>
</div>
</section>
<section id="text-filename">
<h3>/TEXT &lt;文件名<a class="headerlink" href="#text-filename" title="Link to this heading">¶</a></h3>
<p>在扫描或搜索完成后,将结果保存到文本或 CSV 文件中。应用程序将在保存后自行终止。以下示例将扫描您的本地驱动器 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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /TEXT &quot;</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">&quot;</span>
</pre></div>
</div>
<p>文本格式采用针对人类读者的表格格式。如果文件名引用的是 CSV 文件,则会自动使用 CSV 格式。如果要明确使用 CSV 格式,建议使用 /CSV 参数。</p>
</section>
<section id="title-title">
<h3>/TITLE &lt;标题<a class="headerlink" href="#title-title" title="Link to this heading">¶</a></h3>
<p>可用于用自定义文本替换扫描的根路径。这允许为 UNC 路径提供更有意义的名称,从而提高报告的可读性。所选标题将在导出文件时作为报告的标题应用。示例:</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">&quot;</span><span class="se">\\</span><span class="s2">Server3\C$&quot;</span> <span class="o">/</span><span class="n">TITLE</span> <span class="s2">&quot;C: on Data server 3&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;C:</span><span class="se">\r</span><span class="s2">esult.xlsx&quot;</span>
</pre></div>
</div>
<p>在 TreeSize 文件搜索的上下文中,此参数可用于命名高级搜索。示例:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /TITLE &quot;</span><span class="n">Image</span> <span class="n">files</span><span class="s2">&quot; /FILTER &quot;</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">&quot; /PDF &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="topfileslist-filename">
<h3>/TOPFILESLIST &lt;文件名<a class="headerlink" href="#topfileslist-filename" title="Link to this heading">¶</a></h3>
<p>此选项使您能够将顶部文件列表的内容保存为 Excel、HTML、文本或 CSV 文件。文件类型取决于指定文件名的扩展名。示例:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /TOPFILESLIST &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="treemap-filename">
<h3>/TREEMAP &lt;文件名<a class="headerlink" href="#treemap-filename" title="Link to this heading">¶</a></h3>
<p>将扫描的目录树的树图图表保存为位图、GIF、PNG 或 JPEG 文件。文件类型取决于指定文件名的扩展名。示例:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /TREEMAP &quot;</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">&quot;</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>设置用户界面的级别。可能的值是 Simple, Normal, 或 Expert 。示例:</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">&quot;Simple&quot;</span>
</pre></div>
</div>
</section>
<section id="userslist-filename">
<h3>/USERSLIST &lt;文件名<a class="headerlink" href="#userslist-filename" title="Link to this heading">¶</a></h3>
<p>此选项使您能够将按用户名分组的结果统计信息保存为 Excel、HTML、文本或 CSV 文件。文件类型取决于指定文件名的扩展名。导出的列将是上次使用时在“用户”选项卡中启用的列,或在通过 /OPTIONS 提供的配置文件编写时的列。</p>
<p>下面的示例扫描了驱动器 C:,并在 &quot;C:\Temp &quot;中创建了一个 Excel 文件,其中包含该驱动器上用户的统计信息:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /USERSLIST &quot;</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">&quot;</span>
</pre></div>
</div>
</section>
<section id="username-username">
<h3>/USERNAME &lt;用户名<a class="headerlink" href="#username-username" title="Link to this heading">¶</a></h3>
<p>指定用于验证扫描的用户名。使用 /PASSWORD 为该用户名指定密码。建议使用 Microsoft 工具 RUNAS 。</p>
</section>
<section id="userfilter-username">
<h3>/USERFILTER &lt;用户名<a class="headerlink" href="#userfilter-username" title="Link to this heading">¶</a></h3>
<p>使用此选项时,仅会考虑由特定用户拥有的文件进行扫描。在此开关后提供该用户的名称。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>您不能在此处使用多个用户名,但支持通配符 &quot;*&quot; 和 &quot;?&quot;。</p>
</div>
<p>示例:</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">&quot;</span><span class="se">\\</span><span class="s2">Server\GroupDrive&quot;</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 &lt;文件名<a class="headerlink" href="#userschart-filename" title="Link to this heading">¶</a></h3>
<p>将 &quot;用户&quot; 页面底部显示的小图表保存为图像文件(位图、GIF、PNG 或 JPEG)。</p>
</section>
<section id="userspiechart-filename">
<h3>/USERSPIECHART &lt;文件名<a class="headerlink" href="#userspiechart-filename" title="Link to this heading">¶</a></h3>
<p>将当前扫描的 &quot;用户统计&quot; 显示为饼图并保存为图像文件(位图、GIF、PNG 或 JPEG)。</p>
</section>
<section id="viewtype-n">
<h3>/VIEWTYPE n<a class="headerlink" href="#viewtype-n" title="Link to this heading">¶</a></h3>
<p>定义 &quot;父级百分比&quot;、&quot;增长&quot; 列和 &quot;文件年龄&quot; 图表所基于的值。可能的值为:</p>
<p>2: 大小 3: 分配空间(磁盘上的大小) 7: 文件数量</p>
</section>
<section id="xml-filename">
<h3>/XML &lt;文件名<a class="headerlink" href="#xml-filename" title="Link to this heading">¶</a></h3>
<p>将扫描结果保存到 XML 文件中,以便在稍后进行比较。示例:</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">&quot;H:\users</span><span class="se">\&quot;</span><span class="s2"> /XML &quot;</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">&quot;</span>
</pre></div>
</div>
<p>该选项可与 /EXPAND 开关结合使用,以限制导出的目录。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>在将有限的 XML 导出加载到 TreeSize 时,您无法浏览完整的目录分支,而只能浏览导出的目录。</p>
</div>
</section>
<section id="zip-filename">
<h3>/ZIP &lt;文件名<a class="headerlink" href="#zip-filename" title="Link to this heading">¶</a></h3>
<p>该选项只能与命令行选项 /SEARCH 结合使用。</p>
<p>所有作为 TreeSize 文件搜索结果找到的文件将被移动到一个 zip 存档中。示例:</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">&quot;C:</span><span class="se">\&quot;</span><span class="s2"> /ZIP &quot;</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">&quot;</span>
</pre></div>
</div>
<p>另请参见: <a class="reference internal" href="move_checked_files.html#move-checked-files"><span class="std std-ref">移动选中的文件</span></a></p>
</section>
<section id="scanpath">
<h3>&lt;SCANPATH&gt;<a class="headerlink" href="#scanpath" title="Link to this heading">¶</a></h3>
<p>除了参数 /SCAN 之外,还可以在命令行末尾传递某些路径。不过,为了避免在解析命令行时出错,不再推荐这样做。</p>
<p>本示例扫描 &quot;Program Files &quot;和 &quot;Windows &quot;文件夹,并在 &quot;C:eportsScanResults.txt &quot;下创建文本报表:</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">&quot;C:\Reports\ScanResults.txt&quot;</span> <span class="s2">&quot;C:\Program Files&quot;</span> <span class="s2">&quot;C:\Windows&quot;</span>
</pre></div>
</div>
<p>如果发生错误,将作为 Windows 错误代码返回,并在进程的退出代码中显示。文件名中可以使用环境变量(例如 %APPDATA%),同样适用于扫描路径。</p>
</section>
</section>
<section id="scanning-multiple-directories">
<h2>扫描多个目录<a class="headerlink" href="#scanning-multiple-directories" title="Link to this heading">¶</a></h2>
<p>如果您需要扫描多个目录,合并多个调用到一个批处理文件中可能是个好主意,例如:</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">&quot;TreeSize&quot;</span> <span class="s2">&quot;C:\Program Files\JAM Software\TreeSize\Treesize.exe&quot;</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;</span><span class="se">\\</span><span class="s2">Server\Share1&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;D:\Share1.xls&quot;</span>

<span class="n">START</span> <span class="o">/</span><span class="n">WAIT</span> <span class="s2">&quot;TreeSize&quot;</span> <span class="s2">&quot;C:\Program Files\JAM Software\TreeSize\Treesize.exe&quot;</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;</span><span class="se">\\</span><span class="s2">Server\Share2&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;D:\Share2.xls&quot;</span>

<span class="n">START</span> <span class="o">/</span><span class="n">WAIT</span> <span class="s2">&quot;TreeSize&quot;</span> <span class="s2">&quot;C:\Program Files\JAM Software\TreeSize\Treesize.exe&quot;</span> <span class="o">/</span><span class="n">SCAN</span> <span class="s2">&quot;</span><span class="se">\\</span><span class="s2">Server\Share3&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;D:\Share3.xls&quot;</span>
</pre></div>
</div>
<p>命令“START /WAIT”确保作业按顺序启动。通常不并行启动作业更好,因为单个作业可以更好地利用缓存和系统资源。也可以将要扫描的共享存储在文本文件中,并使用 Windows 的“for”命令,如下所示:</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">&quot;</span><span class="si">%%</span><span class="s2">p&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;c:</span><span class="se">\t</span><span class="s2">emp\TreeSize-Reports-%DATE%.xls&quot;</span>

<span class="n">FOR</span> <span class="o">/</span><span class="n">F</span> <span class="s2">&quot;tokens=1&quot;</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">&quot;</span><span class="se">\\</span><span class="s2">Server\</span><span class="si">%%</span><span class="s2">i&quot;</span> <span class="o">/</span><span class="n">EXCEL</span> <span class="s2">&quot;c:</span><span class="se">\t</span><span class="s2">emp\</span><span class="si">%%</span><span class="s2">i.xls&quot;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>在批处理文件中需要使用双百分号字符,而在命令行中只需使用单个百分号。</p>
</div>
</section>
<section id="scheduled-start">
<h2>计划启动<a class="headerlink" href="#scheduled-start" title="Link to this heading">¶</a></h2>
<p>您可以使用 Windows 计划任务以特定的命令行选项每天、每周或每月在特定时间运行 TreeSize。用于 <a class="reference internal" href="schedule_scans.html#scheduling-scans"><span class="std std-ref">调度扫描</span></a> 的对话框将帮助您设置计划任务。</p>
<p>您还可以使用 <code class="docutils literal notranslate"><span class="pre">SCHTASKS</span></code> 命令执行计划扫描。例如,如果您想在下一个晚上 03:00 扫描 C: 和 E: 驱动器并将结果保存到 Excel 文件中,可以使用以下命令行:</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">&quot;&#39;C:\Program Files\JAM Software\TreeSize\Treesize.exe&#39; /SCAN C:\ E:\ /EXCEL C:\Temp</span><span class="se">\t</span><span class="s2">sp.xls /EXPAND 2&quot;</span>
</pre></div>
</div>
<p>有关 <code class="docutils literal notranslate"><span class="pre">SCHTASKS</span></code> 命令的帮助,请访问 <a class="reference external" href="https://technet.microsoft.com/en-us/library/ff356867.aspx?f=255&amp;MSPPError=-2147217396">Microsoft 的页面</a> 或通过输入以下内容:</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>在计划扫描期间发生的错误消息会列在系统的 Windows 事件日志中。</p>
</div>
</section>
<section id="powershell">
<h2>PowerShell<a class="headerlink" href="#powershell" title="Link to this heading">¶</a></h2>
<p>Windows PowerShell 可与 TreeSize 结合使用。本示例展示了如何搜索在 Active Directory(AD)中使用 LDAP 查询的几台远程计算机:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$computer = Get-ADComputer -SearchBase &quot;ou=client computers,ou=intranet,dc=intranet,dc=jam-software,dc=com&quot; -Filter *
foreach ($comp in $computer.name)
{
$path = &quot;\\$comp\C$\Windows&quot;
Add-Content Scan.txt &quot;$path&quot;
}
#debug
Get-Content -Path Scan.txt
# start TreeSize with the collected paths
&amp;&quot;C:\Program Files\JAM Software\TreeSize\Treesize.exe&quot; /SEARCH:Start /SCAN Scan.txt /FILTER *.exe /Export FoundFiles.txt
</pre></div>
</div>
</section>
<section id="redirecting-output">
<h2>重定向输出<a class="headerlink" href="#redirecting-output" title="Link to this heading">¶</a></h2>
<p>如果未指定其他导出目标,TreeSize 将把扫描的简短导出写入标准输出,并将扫描过程中发生的错误写入标准错误。</p>
<p>您可以在命令行 (cmd.exe) 中使用管道符重定向这些输出流,例如:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;C:\Program Files\JAM Software\TreeSize\Treesize.exe&quot;</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">&gt;</span><span class="n">StdOut</span><span class="o">.</span><span class="n">txt</span> <span class="mi">2</span><span class="o">&gt;</span><span class="n">StdError</span><span class="o">.</span><span class="n">txt</span>
</pre></div>
</div>
<p>要使用 PowerShell 重定向输出,请使用 Start-Process 命令,例如:</p>
<p>Start-Process -FilePath &quot;C:Program Files\JAM SoftwareTreeSizeTreesize.exe&quot; -ArgumentList &quot;/NOGUI /SCAN C:&quot; -RedirectStandardOutput &quot;.StdOut.txt&quot; -RedirectStandardError &quot;.StdError.txt&quot;</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>如果您打算使用 Windows Scripting Host (WSH) ,启动 TreeSize 的命令将如下所示:</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">&quot;WScript.Shell&quot;</span><span class="p">)</span>

<span class="n">Shell</span><span class="o">.</span><span class="n">Run</span> <span class="s2">&quot;&quot;&quot;C:\Program Files\TreeSize\Treesize.exe&quot;&quot; /XML &quot;&quot;C:\Reports\drive_c.xml.zip&quot;&quot; /SCAN &quot;&quot;C:</span><span class="se">\&quot;</span><span class="s2">&quot;&quot;</span>
</pre></div>
</div>
</section>
<section id="exit-codes">
<h2>退出代码<a class="headerlink" href="#exit-codes" title="Link to this heading">¶</a></h2>
<p>如果操作成功完成,退出代码为 0。如果发生错误,TreeSize 将返回一个 <a class="reference external" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx">Windows 错误代码</a> 作为退出代码(如果可用),或返回 1 以指示一般错误。</p>
<p>无论如何,Windows 事件日志将在“应用程序”日志中包含更多信息,事件源为“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">如何安排文件搜索</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">所有任务</div>
                
              </div>
            </a>
        </div>
        <div class="bottom-of-page">
          <div class="left-details">
            <div class="copyright">
                Copyright &#169; 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="#">命令行选项</a><ul>
<li><a class="reference internal" href="#all-options">所有选项</a><ul>
<li><a class="reference internal" href="#or-help">/或  /HELP</a></li>
<li><a class="reference internal" href="#ageoffiles">/AGEOFFILES</a></li>
<li><a class="reference internal" href="#appendtofiles-value">/APPENDTOFILES &lt;值</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 &lt;文件名</a></li>
<li><a class="reference internal" href="#compare-filename-path">/COMPARE &lt;文件名|路径</a></li>
<li><a class="reference internal" href="#copy-path">/COPY &lt;路径</a></li>
<li><a class="reference internal" href="#createdpastdaysonly-n">/CREATEDPASTDAYSONLY &lt;n&gt;</a></li>
<li><a class="reference internal" href="#createsnapshot-drive">/CREATESNAPSHOT &lt;驱动器</a></li>
<li><a class="reference internal" href="#csv-filename">/CSV &lt;文件名</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 &lt;收件人</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 &lt;文件路径</a></li>
<li><a class="reference internal" href="#exclude-pattern1-pattern2">/EXCLUDE &lt;pattern1;pattern2&gt;</a></li>
<li><a class="reference internal" href="#expand-level-size">/EXPAND &lt;级别|大小</a></li>
<li><a class="reference internal" href="#expandablereport-value">/EXPANDABLEREPORT &lt;值</a></li>
<li><a class="reference internal" href="#exportdriveslist-filename">/EXPORTDRIVESLIST &lt;文件名</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 &lt;文件名</a></li>
<li><a class="reference internal" href="#exporttitle-title">/EXPORTTITLE <title></a></li>
<li><a class="reference internal" href="#extensionslist-filename">/EXTENSIONSLIST &lt;文件名</a></li>
<li><a class="reference internal" href="#extensionschart-filename">/EXTENSIONSCHART &lt;文件名</a></li>
<li><a class="reference internal" href="#extensionspiechart-filename">/EXTENSIONSPIECHART &lt;文件名</a></li>
<li><a class="reference internal" href="#filter-pattern1-pattern2">/FILTER &lt;pattern1;pattern2&gt;</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 &lt;值</a></li>
<li><a class="reference internal" href="#historychart-filename">/HISTORYCHART &lt;文件名</a></li>
<li><a class="reference internal" href="#html-filename">/HTML &lt;文件名</a></li>
<li><a class="reference internal" href="#import-filename">/IMPORT &lt;文件名</a></li>
<li><a class="reference internal" href="#importpatterns-filename">/IMPORTPATTERNS &lt;文件名</a></li>
<li><a class="reference internal" href="#indexfile-filename">/INDEXFILE &lt;文件名</a></li>
<li><a class="reference internal" href="#listseparator-separator-char">/LISTSEPARATOR &lt;分隔符字符</a></li>
<li><a class="reference internal" href="#move-path">/MOVE &lt;路径</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 &lt;文件名</a></li>
<li><a class="reference internal" href="#options-filename">/OPTIONS &lt;文件名</a></li>
<li><a class="reference internal" href="#pdf">/PDF</a></li>
<li><a class="reference internal" href="#piechart-filename">/PIECHART &lt;文件名</a></li>
<li><a class="reference internal" href="#print">/PRINT</a></li>
<li><a class="reference internal" href="#readonlymode-value">/READONLYMODE &lt;值</a></li>
<li><a class="reference internal" href="#recycle">/RECYCLE</a></li>
<li><a class="reference internal" href="#restrictedmode-value">/RESTRICTEDMODE &lt;值</a></li>
<li><a class="reference internal" href="#scan-path-filename">/SCAN &lt;路径|文件名</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 &lt;格式</a></li>
<li><a class="reference internal" href="#sizeunit-n">/SIZEUNIT &lt;n&gt;</a></li>
<li><a class="reference internal" href="#sortby-columnname">/SORTBY &lt;列名</a></li>
<li><a class="reference internal" href="#sqlite-filename">/SQLITE &lt;文件名</a></li>
<li><a class="reference internal" href="#subject-subject">/SUBJECT &lt;主题</a></li>
<li><a class="reference internal" href="#text-filename">/TEXT &lt;文件名</a></li>
<li><a class="reference internal" href="#title-title">/TITLE &lt;标题</a></li>
<li><a class="reference internal" href="#topfileslist-filename">/TOPFILESLIST &lt;文件名</a></li>
<li><a class="reference internal" href="#treemap-filename">/TREEMAP &lt;文件名</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 &lt;文件名</a></li>
<li><a class="reference internal" href="#username-username">/USERNAME &lt;用户名</a></li>
<li><a class="reference internal" href="#userfilter-username">/USERFILTER &lt;用户名</a></li>
<li><a class="reference internal" href="#userschart-filename">/USERSCHART &lt;文件名</a></li>
<li><a class="reference internal" href="#userspiechart-filename">/USERSPIECHART &lt;文件名</a></li>
<li><a class="reference internal" href="#viewtype-n">/VIEWTYPE n</a></li>
<li><a class="reference internal" href="#xml-filename">/XML &lt;文件名</a></li>
<li><a class="reference internal" href="#zip-filename">/ZIP &lt;文件名</a></li>
<li><a class="reference internal" href="#scanpath">&lt;SCANPATH&gt;</a></li>
</ul>
</li>
<li><a class="reference internal" href="#scanning-multiple-directories">扫描多个目录</a></li>
<li><a class="reference internal" href="#scheduled-start">计划启动</a></li>
<li><a class="reference internal" href="#powershell">PowerShell</a></li>
<li><a class="reference internal" href="#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">退出代码</a></li>
</ul>
</li>
</ul>

          </div>
        </div>
      </div>
      
      
    </aside>
  </div>
</div><script src="_static/documentation_options.js?v=c9a41e7f"></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>