Copy files with delay

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
germano77
Posts: 2
Joined: 22 Jan 2012 03:32

Copy files with delay

#1 Post by germano77 » 22 Jan 2012 03:38

Hi,
this is my first topic.
I want create a file batch that copy only all files txt (option *.txt) from folder test1 to folder test2.
When I copy the files, I want add a delay for any txt file copy.

Example
Copy first file
delay
copy second file
delay
copy third file
delay
..............


Can you help me ?

Thanks

aGerman
Expert
Posts: 4740
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Copy files with delay

#2 Post by aGerman » 22 Jan 2012 09:02

You could use PING.
untested:

Code: Select all

for /r "C:\somewhere\test1" %%i in (*.txt) do (
  copy "%%i" "C:\somewhere\test2\"
  >nul ping -n 2 localhost
)

... where -n 2 means 1 second (3 would mean 2 seconds etc.)

Regards
aGerman

germano77
Posts: 2
Joined: 22 Jan 2012 03:32

Re: Copy files with delay

#3 Post by germano77 » 22 Jan 2012 09:19

Great !!!!!
Thanks

Best Regards

Germano

Post Reply