batch script to find last two days from the current date
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.
精彩评论