Because of the bug I mentioned earlier, the FIRST time this is run, it will not fully work. The script will be uploaded to the router, but it will not execute. Then, after that it will work every time (as long as the script.auto.rsc file exists on the router). MikroTIK confirmed this is a bug, and said they’ll fix it. I haven’t tested it in any later versions.
@echo off
:: CONFIG ::::::::::::::::::::::::::::::::::\
set user=username
set pass=password
set ip=192.168.0.1
:: END CONFIG :::::::::::::::::::::::::::::![]()
:: Window Attributes
title HOTSPOT
mode CON: cols=40 lines=11
:: menu
echo.
echo ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
echo ± ±
echo ± ADD Hotspot User ±
echo ± ±
echo ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
echo.
echo.
for /f %%A in (‘“prompt $H &echo on &for %%B in (1) do rem”’) do set BS=%%A
set /p input=%BS% -^> Enter name:
:: mikrotik script
echo /ip hotspot user add name=“%input%” profile=multipleuser>script.auto.rsc
:: ftp commands to upload script
echo user %user%> ftp.dat
echo %pass%>> ftp.dat
echo put script.auto.rsc>> ftp.dat
echo quit>> ftp.dat
:: upload script
ftp -n -s:ftp.dat %ip%> NUL
:: cleanup
del /q ftp.dat
del /q script.auto.rsc