AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 727714
Accepted
mrbarker
mrbarker
Asked: 2015-10-09 12:18:00 +0800 CST2015-10-09 12:18:00 +0800 CST 2015-10-09 12:18:00 +0800 CST

有没有办法运行搜索文件但不包括隐藏文件和文件夹的脚本文件?

  • 772

我需要在某些 Windows 服务器中搜索在某个日期之后创建的文件。我已经用 forfiles 设置了一些东西,但希望通过不搜索隐藏文件和文件夹来加快进程并减小输出文件的文件大小。我已经看过并且找不到任何东西。

如果它完成回答问题,我愿意使用除 forfiles 之外的其他东西。

windows-server-2008
  • 1 1 个回答
  • 311 Views

1 个回答

  • Voted
  1. Best Answer
    JosefZ
    2015-10-10T05:46:52+08:002015-10-10T05:46:52+08:00

    你很接近你的评论。根据有目的的摘录xcopy /?:

    XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                               [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
                               [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/J]
                               [/EXCLUDE:file1[+file2][+file3]...]
    
      source       Specifies the file(s) to copy.
      destination  Specifies the location and/or name of new files.
      /D:m-d-y     Copies files changed on or after the specified date.
                   If no date is given, copies only those files whose
                   source time is newer than the destination time.
      /EXCLUDE:file1[+file2][+file3]...
                   Specifies a list of files containing strings.  Each string
                   should be in a separate line in the files.  When any of the
                   strings match any part of the absolute path of the file to be
                   copied, that file will be excluded from being copied.  For
                   example, specifying a string like \obj\ or .obj will exclude
                   all files underneath the directory obj or all files with the
                   .obj extension respectively.
      /S           Copies directories and subdirectories except empty ones.
      /E           Copies directories and subdirectories, including empty ones.
      /L           List only - Displays files that would be copied.
    
      /C           Continues copying even if errors occur.
      /H           Copies hidden and system files also (default=NO).
    

    由于XCOPY将接受UNC路径名,下一个示例(列出今天从C:\Windows文件夹及其192.168.1.100服务器的子文件夹更改或创建的所有文件,不包括文件中指定的E727714.txt文件夹)可能会有所帮助:

    ==> type E727714.txt
    \system32\
    \sysWOW64\
    \SoftwareDistribution\
    
    ==> xcopy \\192.168.1.100\C$\windows /C /S /L /D:10-09-2015 /EXCLUDE:E727714.txt>727714.log
    
    ==> type 727714.log
    \\192.168.1.100\C$\windows\WindowsUpdate.log
    \\192.168.1.100\C$\windows\debug\mrt.log
        ... (some lines omitted)
    \\192.168.1.100\C$\windows\Temp\MpSigStub.log
    13 File(s)
    
    ==>
    
    • 2

相关问题

  • 文件复制到分支机构

  • 对于 ASP.Net 应用程序,Windows 64 位相对于 32 位的主要优势是什么?

  • Windows Server 2008 Hyper-V 虚拟化服务器的最佳 RAID 配置?

  • 远程连接 sql server 不工作,但如果防火墙禁用它呢?

  • 无法从 SQL Server 2008 备份数据库

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve