FORFILES不到4天 [英] FORFILES less than 4 days old
本文介绍了FORFILES不到4天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我有麻烦试图与FORFILES摸不着头脑。我试图让没有更多然后是4天之久的文件。所以基本上任何少于4天。然而,它似乎并不太可能的,因为/ D -4获取所有项目4天或以上。
So I'm having trouble trying to figure this out with FORFILES. I'm trying to get files that are no more then 4 days old. So essentially anything less than 4 days. However it does not seem quite possible since the /d -4 gets all items 4 days or older.
下面是我有这么远。</ P>
Below is what I have so far.
FORFILES /p T:\Downloads /m *.exe /c "cmd /c copy @path T:\Downloads\Applications | echo Copying @path" /d +4
任何人都知道这是可能的吗?或者,也许是更好的选择?
Anyone know if this is possible? Or maybe a better alternative?
推荐答案
这可能会为你工作:
@echo off &setlocal
cd /d "T:\Downloads"
(for %%a in (*.exe) do @echo "%%~a")>dir.txt
for /f "delims=" %%a in ('forfiles /d -4 /m *.exe ^|findstr /vig:/ dir.txt') do echo Copying %%a© "%%~a" "T:\Downloads\Applications"
del dir.txt
不幸的是,这并不在XP中运行。
Unfortunately this doesn't work in XP.
这篇关于FORFILES不到4天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文