Passwords into SC.EXE can't have a backslash at the end

Hi,

So we use randomly generated passwords for service accounts and just had one which wouldn’t work when assigned to a Windows Service. We tried lots to see what the problem was, but then we realised it had a backslash on the end and that might be causing issues. Entering it when manually calling SC CONFIG worked fine, but anything through OD was failing. Finally we doubled the backslash and it worked fine.

e.g.
Broken = '(abcd))123’
Working = ‘(abcd))123\’

Thanks
/Matt

Hi Matt,

So I did a bit of investigation and it seems escaping backslashes for cmd args is magic!
According to https://weblogs.asp.net/jongalloway/5B002E00_NET-Gotcha_5D00-Commandline-args-ending-in-5C002200-are-subject-to-CommandLineToArgvW-whackiness the rules seem to be quite strange.

I have raised an issue, feel free to subscribe to it to get updates - https://github.com/OctopusDeploy/Issues/issues/3505

Cheers
John

Closing as this got fixed thanks!