orbit
orbit

Reputation: 101

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 days lesser than the current date. How can we achieve this using a batch script in Windows?

Appreciate your help!

Upvotes: 0

Views: 1525

Answers (2)

wilson
wilson

Reputation: 421

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.

Upvotes: 2

Simmo
Simmo

Reputation: 3131

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

Upvotes: 0

Related Questions