User guide

280 Chapter 6. Managing the Router
¥ Select the Tools | Execute Script menu item and choose the script file you just prepared. When you click
OK, the script file is loaded to the router (under the name AUTOEXEC.BAT) and the router is restarted, thus
executing the script.
Alternatively, you can manually transfer the script file from your PC to the router using the following method:
¥ Start the TFTP server on your PC and set the root directory where the script file is located.
¥ Use the following command to copy the script file to the router file system:
copy tftp@ <PC_IP_address>:<PC_file> <router_file>
¥ To process the commands in the script file, you can either reboot your router (if the script file was copied
under the name AUTOEXEC.BAT onto the router) or use the command execute <file>.
Note: If present, the file AUTOEXEC.BAT is renamed AUTOEXEC.OLD before it is executed, so that it is only
run once. If you clear the router configuration with the Reset Defaults button of the Upgrade/Backup tool or the
reboot default command, the AUTOEXEC.OLD is renamed back to AUTOEXEC.BAT and re-run after the boot
up, thus restoring your configuration.
You can include the commands rename <autoexec.old> <autoexec.bat> or reboot in a script file; there is no
limitation on the commands that you might define in your scripts. The rename command is useful if you need the
script to execute on every startup, whereas the reboot command is useful to apply changes and have them take
effect (almost) immediately.
Caution: If you create a one-time script file (copied to the router under the name AUTOEXEC.BAT), do not
include the commands rename <autoexec.old> < autoexec.bat> and reboot at the same time. This will result in
an endless loop of starting the router, executing the script, restarting the router, re-executing the script.