Copy all files that are created till 10 mins back

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
gsenthilkumar
Posts: 1
Joined: 28 Oct 2009 23:13

Copy all files that are created till 10 mins back

#1 Post by gsenthilkumar » 28 Oct 2009 23:24

Hi,
I need a Windows batch script, which copies all files from a folder, that are written till 10 minutes before (by checking with the system time) to another folder.

Could anyone help me plz?

Thanks
Senthil

X-Zat
Posts: 8
Joined: 31 Oct 2009 07:58
Contact:

#2 Post by X-Zat » 31 Oct 2009 08:54

Well...
I can give you some advices but not any help.

I would try this:

1. First, create a script that checks all files and writes them down (with all attributes like time and date of creation) into a *.txt-file.

2. Now create a script that compares the files' time with your system time and writes chosen files down into another *.txt-file.

3. The last step is easy: Create a file that reads the second *.txt-file and automaticalls xcopies them to a destination folder

or

3.a Let the second script add a line to the third script:

Code: Select all

echo xcopy %file% %destination%>>thirdbatch.bat


while the third batch includes

Code: Select all

@echo off
title blablabla
:precheck
if exist secondtxt-file.txt echo Begin Copying now!
if exist secondtxt-file.txt goto checklist
if not exist secondtxt-file.txt goto error
:error
echo blablabla
:checklist
REM Here will be the entries made by the second batch!


As I said, I do not know if this could help you - This is not very complicated, it's simple.

Bye, X-Zat[/code]

Post Reply