For
/user add name=abcde password=q?9^'pcT5jZ*z group=full the correct syntax
only on TERMINAL is:
v6 and before code
/user add name="abcde" password="q\?9^'pcT5jZ*z" group="full"
From one v7 version code
/user add name="abcde" password="q?9^'pcT5jZ*z" group="full"
The only characters usable on terminal are:
[SPACE] ! " # $ % & ' ( ) * + , - . / 0...9 : ; < = > ? @ A..Z [ \ ] ^ _ ` a..z { | } ~
Some localized keyboards do not have some symbol, like the Italian keyboard do not have ` and ~
For some reaason the terminal do not accept <ALT>+code for insert that characters, like do not accept <ALT>+<Keypad 1,Keypad 2,Keypad 6> for the ~
Various methods can be used for paste/digit it directly on terminal, but unsupported characters still unsupported.
A good method is put the string everytime inside quotes, except if are obtained directly from one variable/function
All special characters must be put inside quotes, or, for one reason or another, cause errors.
Some chracters must be escaped
" if used as character, and not for contain a string, must be escaped like
\"
$ if used as character, and not for start a variable or function name, must be escaped like
\$
? on RouterOS 6.x Terminal must be escaped with \ like
\? (stored script inside scirpt, scheduler, dhcp, ppp profiles, etc. , do not need to escape the ? )
\ the \ is the escape symbol, for use \ as character instead, escape it like
\\
All the others must not be used because RouterOS terminal do not support the remaining characters and the 16 bit chars.
For set a password (with one space at start) like
!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
TERMINAL ONLY code
# added backslash before quote, dollar, question mark and backslash
/user add group="full" name="usethedamnquotesforstrings" password=" !\"#\$%&'()*+,-./09:;<=>\?@AZ[\\]^_`az{|}~"
SCRIPT, SCHEDULER, PPP Profile Script, DHCP Lease Script, NETWATCH and all the others with Script section code
# added backslash before quote, dollar and backslash - NOT before question mark
/user add group="full" name="usethedamnquotesforstrings" password=" !\"#\$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~"
WINBOX OR WEBFIG code
# put directly the input on fileld without escapes or quotes (is present one space at start of the string)
!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
Some other codes visible on exports:
\ before one [SPACE] or [TAB] or [carriage-return] or [line-feed]
mean the script continue on next non-white space (ignore all space, tab, carriage return, line-feed). Often used by "export".
\_ = [SPACE] when significant space can be misunderstanded with useless [SPACE]
\t = [TAB] when significant [TAB] can be misunderstanded with useless [TAB]
\r = [carriage-return] when significant [CR] can be misunderstanded with useless [CR]
\n = [line-feed] when significant [LF] can be misunderstanded with useless [LF]
Example
/system script
add name=test owner=\
admin source=":put\
\_\"test tab and cr/lf \
\t\r\
\n\"\r\
\n:put \"hey\""