“Command line error.” when using the STSADM command-line tool

2017-12-01T10:06:25+00:00 January 20th, 2012|Windows|

When using the SharePoint command-line tool STSADM, you may receive “Command line error.” even though the syntax is correct:

image

Solution

Manually type out the command rather than copying/pasting from another application such as Internet Explorer. This is caused by the encoding method, particularly any hyphens in the command. Hyphens and dashes vary between ANSI and UTF-8 encoding.