How to skip runtime error then go for the next command...

Hi,
we have 1000++ on air mikrotik, currently we use some scheduler and fetch to make it take command from one of the server.

But, the problem is, due to some equipment is new some is old, when there is 1 line command no exist, it will auto stop due to run time error.

is there any method that, when there is runtime error (or command no valid) it will go to next line instead of stop there.

p/s: if i copy and paste manually into the new terminal, then system will ignore it, but just with script, it will stop it.

thanks.

Ideally, you want to eliminate the errors so that your commands work across all routers. For the code giving you problems, you could use a script to detect the RouterOS version and then execute the version specific commands:

if ([:pick [/system resource get version] 0] <= 3) do={
	code here for v3 or earlier...
} else={
	if ([:pick [/system resource get version] 0] = 4) do={
		code here for v4...
	} else={
		if ([:pick [/system resource get version] 0] = 5) do={
			code here for v5...
		} else={
			code here for any other version (6 or greater)...
		}
	}
}

hi…

i got it with help my Martin…
:global userID [/user find name=“UserA”]; :if ( $userID != “”) do={ /user remove $userID }