Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: XP Search command  (Read 2779 times)

0 Members and 1 Guest are viewing this topic.

ckelly0172

  • Guest
XP Search command
« on: May 03, 2007, 03:33:38 PM »
Hi there,

Would it at all be possible to create a batch file in XP that would do a search in a specified location for any files that have a 'created/modified' date older that say a month. And then delete the files found.
Any help greatly appreciated.
Craig.

jothish

  • Guest
Re: XP Search command
« Reply #1 on: May 04, 2007, 03:32:16 AM »
Write dir command output to a file.
Then search the file using findstr command and get the file name.
Use delete command to delete the file.

Hope this helps
Jothish

contrex

  • Guest
Re: XP Search command
« Reply #2 on: May 04, 2007, 03:39:10 AM »
Try XXCOPY (a freeware for personal use)

  http://www.xxcopy.com/

It is a general purpose file management tool that can copy,
delete, list, etc.  The command syntax is compatible with
that of XCOPY.  It offers a wide variety of file-selection
mechanisms that includes file size, file date, age, attributes,
etc. just to name a few.

E.g.,

 xxcopy "c:\My Documents\*.doc /rs/s/db#30  // 30 days or older
 xxcopy c:\   /rs/s/db:1998-04-30       // files made Apr,98 or before   

ckelly0172

  • Guest
Re: XP Search command
« Reply #3 on: May 04, 2007, 04:56:38 AM »
Hi chaps, thanks for your replies.

xxcopy seems to do just the trick. although i would also like to be able to do it in a batch file also.
Is it possible to use dir to list files of a certain age? then i could output to another folder and delete.

contrex

  • Guest
Re: XP Search command
« Reply #4 on: May 04, 2007, 05:35:19 AM »
you can call xxcopy from a batch file if you put the xxcopy executable somewhere on your PATH.