Friday, December 2, 2011

STSADM ' - ' Command line error



Scenario:
All parameters passed to stsadm command are correct but it still complains about "Command line error". This is an encoding issue.


Solution:
e.g. If this command does not work on cmd prompt,
       stsadm -o enumsites -url http://myurl -databasename dbname
      - Paste this command in a notepad and try to search for -databasename 
      - Notepad will return "cannot find -databasename " although you can see it there.
The '-' is not getting encoded correctly. Simply delete the - and retype it in notepad. Copy and paste it in cmd prompt and execute. It will work. This problem may occur with any '-' parameter.




Reference:
http://weblogs.asp.net/soever/archive/2007/12/22/sharepoint-stsadm-exe-and-the-infamous-quot-command-line-error-quot.aspx

No comments:

Post a Comment