views:

92

answers:

3

Hi All,

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 !

Regards, Renju.

A: 

This tutorial should help you get started.

Manoj Govindan
orbit
A: 

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

Simmo
+1  A: 

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.

wilson