Thank for your response helpmeh,
could you explanin some of the syntax pls so i have a better understanding in the future
Well, the set command should be fairly obvious to you. But here's how the for loop works.
for /f
The command with the /f switch. See FOR /? for more information on other switches.
"tokens=1,2
Part one of the options. Specifies that the first 2 tokens are used. By default is 1.
delims=."
Part 2 of the options. It tells the command where to divide the output (see later) by for each token. Must be used last. By default is a space and/or a tab.
%%a
Specifies the first for variable (or the only one in some cases).
in
(self-explanitory)
('dir /b *.log')
Collects the output from that command (see DIR /? for more info on that command).
do
(self-explanitory)
If not "%%a" LSS "%mindate%"
If the value of %%a is not less than the value of %mindate% do:
If not "%%a" gtr "%maxdate%"
If the value of %%a is not greater than the value of %maxdate% do:
Copy %%a.%%b TARGETLOCATION
Copy the value of %%a.%%b (which is the file's name .log ex 20090801.log) to the target location (TARGETLOCATION), which you had to specify.
If you need any more help, feel free to ask.