gorcon / rcon-cli

RCON client for executing queries on game server.
MIT License
482 stars 45 forks source link

Windows - Command with double quotes treated as separate commands #25

Closed RobertKalnins closed 1 year ago

RobertKalnins commented 1 year ago

Tested on a Zomboid server on Win10 - 22H2, but had same issue on a previous version.

Issue: Command with double quotes treated as multiple commands on windows systems

Expected behaviour: 'command "string-for-command"' passes the command with "string-for-command" to rcon server

Experienced behaviour: command is treated by rcon client as multiple separate commands

Not working in Powershell - PSVersion - 5.1.19041.2364 Haven't tested on other versions of powershell. image

Not working in cmd: image

Working in WSL - Ubuntu: image

Also works in my Linux server with no problems

outdead commented 1 year ago

I don't have this fiend. But I'll try to check. Thanks for report!

outdead commented 1 year ago

Try .\rcon -c .\rcon.yaml "servermsg \"Test test test\""

RobertKalnins commented 1 year ago

Powershell: Didn't work with "servermsg \"Test test Test""

Worked with 'servermsg \"Test test Test"'

Command prompt: Didn't work C:\rcon-0.10.2-win64>rcon.exe -c .\rcon.yaml 'servermsg \"Test2 test2 Test2"' Unknown command 'servermsgEscape character did it for powershell

Cheers for the suggestion - the powershell one should be good enough for our use case