none
Stsadm addsolution operation generates "Command line error" RRS feed

  • Question

  • Why does the following command prompt line generate a "Command line error" ? What is the problem ?

    C:\Users\Administrator>"C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN\stsadm" -o addsolution -filename "C:\temp\Templates\ApplicationTemplateCore.wsp"

    Command line error.

     

    Friday, April 24, 2009 11:04 PM

Answers

  • One question. Did you make copy paste on cmd "ms-dos", some time ago have this issue, if i make copy paste my stsadm command line give the exact error but if i make by hand everything went well, could you try that please?
    A way to resolve that problem was creating the bat file to dont have that issue.

    Thanks.

    André Lage Microsoft SharePoint and CRM Consultant http://aaclage.blogspot.com
    Sunday, April 26, 2009 8:41 AM
  • Hello Don,

     

    I agree with Andre that pasting the command-line from some web pages or programs to Command Prompt is a very possible cause.

     

    The root cause of the issue is related to the dash in the command-line. If you copy these commands from the web page into Wordpad firstly, the problem becomes clear. On some of the commands, there is a double dash character (stsadm --o addsolution --filename) instead of a single dash. When those commands are pasted into a text only program like the command prompt or Notepad, they appear to be a single dash, but they are still interpreted as a double dash. This is why the command fails even though it looks correct.

     

    To resolve this issue, there are two options to choose:

     

    ·         Type the commands manually instead of copying and pasting them from other sources.

    ·         Copy them into Wordpad, change all the double dashes to single and then copy them into the command prompt.

     

    Thanks.

     

    Best Regards,

    Lionel

    Wednesday, April 29, 2009 3:35 AM

All replies

  • I think you are calling stsadm in a wrong way.

    you can create a .bat with name install.bat with following lines

    path c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\
    stsadm -o addsolution -filename c:\templates\ApplicationTemplateCore.wsp
    stsadm -o deploysolution -name ApplicationTemplateCore.wsp -local -allowgacdeployment
    stsadm -o copyappbincontent


    Microsoft on his site recomends


    Installing the core:
    1. Pull the core file, ApplicationTemplateCore.wsp, from the extracted distribution. The core solution file will be added to the solution store, a table in the Windows SharePoint Services configuration store that holds solution files.
    2. Via command line, run stsadm -o addsolution -filename <file_path>\ApplicationTemplateCore.wsp
    3. Next, run stsadm -o deploysolution -name ApplicationTemplateCore.wsp -allowgacdeployment
      (Additional attributes may be required based on your Windows SharePoint Services configuration. For example:
      Single Server: [ -local | -time <time to deploy at> ]
      Farm: [ -immediate | -time <time to deploy at> ]
      To see the list of attributes, run stsadm -help deploysolution)
    4. Finally, run stsadm -o copyappbincontent

    André Lage Microsoft SharePoint and CRM Consultant http://aaclage.blogspot.com
    • Marked as answer by Mike Walsh FIN Saturday, April 25, 2009 5:24 AM
    • Unmarked as answer by DonBaechtel Saturday, April 25, 2009 1:58 PM
    Friday, April 24, 2009 11:20 PM
  • It really is a whole lot easier to seperate out the stsadm path.  If you don't want to do it in a bat file as Andre recommends you can always just start with a cd command that changes the path to the bin folder.  This allows you to have an interactive session where you type various commands as needed.

    One other thing I'll note.  If you copied the call from the internet, I frequently have trouble with the hyphens.  There are different sized hyphens "-" that are interpreted differently.  If you cut and pasted it from the web, just go back over them and replace them.  It has driven me crazy more than once, so I just do it by default now.
    SharePoint Developer | Administrator | Evangelist -- Twitter -- Blog - http://nextconnect.blogspot.com
    Friday, April 24, 2009 11:52 PM
  • What is wrong with the way I am calling stsadm?

    stsadm is running OK, it just says something is wrong with the command line. What is wrong with the command line?

    file path C:\temp\Templates\ApplicationTemplateCore.wsp is correct on my system.
    Friday, April 24, 2009 11:54 PM
  • To get the error you did, there is nothing wrong with the stsadm part.  I would look at the hyphens.

    SharePoint Developer | Administrator | Evangelist -- Twitter -- Blog - http://nextconnect.blogspot.com
    Friday, April 24, 2009 11:56 PM
  • One question. Did you make copy paste on cmd "ms-dos", some time ago have this issue, if i make copy paste my stsadm command line give the exact error but if i make by hand everything went well, could you try that please?
    A way to resolve that problem was creating the bat file to dont have that issue.

    Thanks.

    André Lage Microsoft SharePoint and CRM Consultant http://aaclage.blogspot.com
    Sunday, April 26, 2009 8:41 AM
  • Hello Don,

     

    I agree with Andre that pasting the command-line from some web pages or programs to Command Prompt is a very possible cause.

     

    The root cause of the issue is related to the dash in the command-line. If you copy these commands from the web page into Wordpad firstly, the problem becomes clear. On some of the commands, there is a double dash character (stsadm --o addsolution --filename) instead of a single dash. When those commands are pasted into a text only program like the command prompt or Notepad, they appear to be a single dash, but they are still interpreted as a double dash. This is why the command fails even though it looks correct.

     

    To resolve this issue, there are two options to choose:

     

    ·         Type the commands manually instead of copying and pasting them from other sources.

    ·         Copy them into Wordpad, change all the double dashes to single and then copy them into the command prompt.

     

    Thanks.

     

    Best Regards,

    Lionel

    Wednesday, April 29, 2009 3:35 AM