List of hotspot users to a file

Hi everyone!

I’m trying to make a script that do the same as the following command line:

/ip hotspot user print file=users.txt

I have read in a lot of sites that mikrotik scripts don’t let do this (and I have proved it by my self), but I want to know if there is some solution for this. I mean, an script that can write to a file all the hotspot users from a mikrotik.

Thank you all!

What RouterOS are you using?

It works fine for me on v5.22, in the terminal or in a script.

RouterOS v5.12…

If you run it in the terminal, does it give you an error?

No…in terminal it works…

Have you tried upgrading to v5.22?

Not yet…it will be the next step. Wen It will be done, i will tell you what has happened…

Upgrade to 5.22 and happens the same…the script doesn’t work…

In script, do you have correct permissions set?
script-permissions.png

Is this code part of a larger script?

Can you provide some links to these sites?

Yes…this is the script configuration. And the whole script (there isn’t more lines).

I send you an example that tells that “print file” doesn’t work in script:

http://forum.mikrotik.com/t/scheduler-and-script-creating-file/36004/1

Thank you!

Looks like his problem was related to the way he was running the script in the scheduler: http://forum.mikrotik.com/t/scheduler-and-script-creating-file/36004/1

Where are you running the script from?

I think that this is not the problem, because I running the script alone, without a schedule. i’m running the script in a Rb433 AH.