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
  • 31,767
  • 12
  • 51
  • 89
ri2312
  • 9
  • 1
  • 3
    That is not a Windows batch file, _the I lines you've posted are not the entire content of an executable text file with a `.bat` or `.cmd` extension_. Please revisit the question and provide a fully understandable replicable issue with your code, explain exactly what you're doing and what happens when you do so. Please also ensure that you're using the appropriate tags. Please also note that StackOverflow is not a free code writing service, we aren't here to create your code for you, just to help you to fix a specific issue with your own code. – Compo Jun 26 '19 at 14:18
  • 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
  • 167,268
  • 50
  • 405
  • 846