Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DOS Script, Move Files by Date from one folder to another

248 views
Skip to first unread message

cc77...@gmail.com

unread,
Jul 3, 2008, 4:05:21 AM7/3/08
to
Hi,

I'm looking for a simple DOS script to do the following:

*Script will be kicked off monthly by OS Scheduler Service*

1. Create Folder B (If it doesn't already exist) Folder name must be
YYYYMM in the name.
2. Go to Folder A and move all files older than 1 month to Folder B

(Oh, no installation of any 3rd party type utilities can be used, just
plain simple DOS that game with Win 2000)

Seems simple. Can anyone help out?

Thanks.

Richard Bonner

unread,
Jul 6, 2008, 10:45:35 AM7/6/08
to
cc77...@gmail.com wrote:

> I'm looking for a simple DOS script to do the following:

> *Script will be kicked off monthly by OS Scheduler Service*

> 1. Create Folder B (If it doesn't already exist) Folder name must be
> YYYYMM in the name.
> 2. Go to Folder A and move all files older than 1 month to Folder B

> (Oh, no installation of any 3rd party type utilities can be used, just
> plain simple DOS that game with Win 2000)

*** There is no DOS with WIN 2000; it's a somewhat compatible Windows
command-line interface.

For DOS users: This can be done with DOS alone, but it requires many
lines of code to isolate the year and month from the DATE command, and to
either isolate one-month-old files or use XCOPY to temporarily isolate
files less than one month old and then move what is left.

My preference would be to use XSET to define the directory name as
"YYYYMM", then to use XXCOPY's `/DB:' switch to move files more than a
month old into that directory.

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

0 new messages