commandline change password with strange characters

Hi,
I like to change my password.
Do this in the terminal but I want to use this:

/user set admin password=“!@test#$”
But think the characters !@#$ are not accepted or one of them is not accepted.

How to do this?
Is it possible to escape thes characters?

I have the same problem when I like to change or add a WPA2PSK-key with such characters

In your particular example, it seems the problem is with the “$”. That is used to indicate a variable reference, and yet you don’t have a name.

You can escape it (and most special characters) with "" in front, e.g.

/user set admin password="!@test#\$"

In more general terms, you can escape ANY character by substituting it with "", followed by two hex digits, to indicate its ASCII value (or if you’re escaping Unicode, this would be escaping one byte from the character), so e.g.

/user set admin password="\21\40test\23\24"