[undocumented]MSG special characters and escaping them

Microsoft Windows
Post Reply
User avatar
Posts: 336
Joined: 2021-Jul-12, 1:37 pm

[undocumented]MSG special characters and escaping them

Post by MigrationUser »

11 Dec 2015 14:51

Some tests I've made over MSG command (aware that you need installed terminal services to make this command available) showed that there are some special characters that cannot be set at the beginning of the message ( / and - ):

Code: Select all

msg "%username%" "--#"
msg "%username%" "//#"
both lines will print the help message .

They can be esacped with \ (only the first appearance need to be escaped):

Code: Select all

msg "%username%" "\--#"
msg "%username%" "\//#"

it can be used also to put as message with quotes in :

Code: Select all

msg "%username%" "\"message with quotes\""
I havent found other special sequences that can be used with \

Max length of the symbols in the message is 255

Last edited by npocmaka (11 Dec 2015 15:11)


#2 11 Dec 2015 23:41
Simon Sheppard

I've updated https://ss64.com/nt/msg.html with this

Thanks npocmaka
Post Reply