Save script source file

I need to write an auto run script so that it will run everytime the router starts. How to do that? Should I write the script as a file and save it in the router’s memory? If so, how to save the file in the router’s memory? Please advice. Thank you very much.

Just make a normal script. Then use scheduler to run it on ‘startup’. In later RouterOS versions sometimes you have to put a :delay 10 at the beginning on startup scripts for some reason.

I use winbox to write script and the scheduler. However when I reboot the router, winbox will automatically close and I don’t know whether my startup script can be executed at startup. Any suggestion? Thank you very much.

Hi GP01Fb

I suggest you add something like this:

:log info “The script is starting”
at the start of your script and perhaps something like:

:log info “The script completed succesfully”
at the end of the script. This you should be able to read in your log.

hope it helps! G