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


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.

Broken = '(abcd))123’
Working = ‘(abcd))123\’


Hi Matt,

So I did a bit of investigation and it seems escaping backslashes for cmd args is magic!
According to the rules seem to be quite strange.

I have raised an issue, feel free to subscribe to it to get updates -


Closing as this got fixed thanks!