0

im on Windows 10. I want my script to run every few seconds or, if even possible, every second. I need it so i can get Every Picture on my FTP Server as soon as possible without any delay

I have tried to do it with task scheduler, but the fastest i can do is every 5 Minutes

Administrator
Pw123
cd Kamera-1
lcd C:\xampp\htdocs\website\Bilder\Kamera-1
binary
mget *.jpg
mdel *.jpg
bye

Here is my Script. The first 2 Lines are the Logins to my FTP Server and the rest is just to get the files and then delete the files on the ftp, so i dont download it twice

aschipfl
  • 33,626
  • 12
  • 54
  • 99
ri2312
  • 9
  • 2
  • 5
    Frame Challenge: If all you are doing is Syncing files/folders, then perhaps consider using a File-Syncing program, such as WinSCP, AOMEI, WebDrive, or SyncBack. Also, since this is about **scheduling** and not **code**, it might be a better fit on [su] instead of [so] – Chronocidal Jun 26 '19 at 14:28
  • 1
    See [Run a batch file with Windows task scheduler](https://stackoverflow.com/q/4437701/850848). – Martin Prikryl Jun 26 '19 at 15:10
  • 1
    Speaking from experience, a batch script that runs every second will slam your CPU and make your computer unusable. Look into folder synchronization software instead. – SomethingDark Jun 26 '19 at 17:17

1 Answers1

0

To answer your literal question: Just loop your code in the batch file, with a short delay:

:start

<your code here>

timeout 5

goto start

Though as said in the comments, there are better ways to achieve what you want.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992