我需要search一些Windows服务器,以查找某个date之后创build的文件。 我已经用forfiles设置了一些东西,但是希望通过不search隐藏的文件和文件夹来加快处理速度并减小输出文件的文件大小。 我看了,无法find任何东西。
如果能够回答这个问题的话,我愿意使用其他的文件。
你接近你的评论。 根据有意从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:mdy 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将接受UNCpath名,所以下一个示例(列出从C:\Windows文件夹及其子文件夹192.168.1.100服务器(不包括E727714.txt文件中指定的文件夹)更改或今天创build的所有文件)可以帮助:
==> 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) ==>