Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a simple question, but I don't remember the batch syntax very well. If I want to create a batch file that transfers all the files in Folder A to Folder B every 20 minutes, what does the batch file need to look like?

I think something like this:

-script that search if there are files -
-script that moves the files to the folder B-
sleep(x seconds)
go to 1;

Thanks all

share|improve this question
What operating system are you on? Are you talking about a .bat file on Windows that will perform this? –  Raystafarian Mar 2 '12 at 18:53
add comment

2 Answers

I would suggest writing a batch file to move those files without any sleeps or gotos, then set up a scheduled task to run that batch file every 20 minutes. Although this doesn't directly answer your question, I think it's what you want to achieve from asking your question.

If you did want to use your method, try:

commands here...
GOTO Label1
share|improve this answer
I can try also the schedule, but i don't know really how it work, i have present the scheduler but don't know how to use or configue. With Label1 what execute? and what commands i need to write? Thanks –  Synthoras Mar 2 '12 at 11:54
add comment

I'm assuming you are using XP or up.

Using the Task scheduler makes more sense here. It will use less CPU.

schtasks /create /sc minute /mo 20 /tn "Copy file X per 20min" /tr "path to your batchfile" /k

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.