开发者

batch script to find last two days from the current date

开发者 https://www.devze.com 2023-01-11 17:02 出处:网络
I am in a project where I need to find all files which are two 开发者_如何学Pythondays lesser than the current date. How can we achieve this using a batch script in Windows?

I am in a project where I need to find all files which are two 开发者_如何学Pythondays lesser than the current date. How can we achieve this using a batch script in Windows?

Appreciate your help!


I have previously misunderstood the question. Here is the updated answer.

The syntax is a little bit different for different OS.

forfiles /d +2      (Windows Server 2008)
forfiles -d+2       (Windows 2000)

In case there is no such command in your OS, here is a link for downloading the FORFILES command.

You can even specify what you want to do for those files. Type forfiles /? or forfiles -? for help.


Not sure what you want to do with the files after you have found them but you could use the ForFiles command.

0

精彩评论

暂无评论...
验证码 换一张
取 消