none
error MSB6006: "cmd.exe" exited with code 1. RRS feed

  • Question

  • I tried to migrate a CPP project from Visual studio 2008 to 2010 on Windows 7. I got the error MSB6006: "cmd.exe" exited with code 1. I suspect it has something to do with tortoiseSVN or subwcrev.exe, but I cannot figure out what.

    I looked through the internet and found related topics but none worked in my case. Below is the detailed information:

    1>------ Build started: Project: jabberd2, Configuration: Debug Win32 ------
    1>Build started 10-03-2014 12:27:23.
    1>InitializeBuildStatus:
    1>  Touching "Debug\jabberd2.unsuccessfulbuild".
    1>CustomBuild:
    1>  Updating E:\ProjectWork\my jabberd2\jabberd-2.3.1\win32\include\version.h
    1>  SubWCRev 1.8.5, Build 25224 - 32 Bit 
    1>  
    1>  Usage: SubWCRev WorkingCopyPath [SrcVersionFile DstVersionFile] [-nmdf]
    1>  
    1>  Params:
    1>  WorkingCopyPath    :   path to a Subversion working copy.
    1>  SrcVersionFile     :   path to a template file containing keywords.
    1>  DstVersionFile     :   path to save the resulting parsed file.
    1>  -n                 :   if given, then SubWCRev will error if the working
    1>                         copy contains local modifications.
    1>  -N                 :   if given, then SubWCRev will error if the working
    1>                         copy contains unversioned items.
    1>  -m                 :   if given, then SubWCRev will error if the working
    1>                         copy contains mixed revisions.
    1>  -d                 :   if given, then SubWCRev will only do its job if
    1>                         DstVersionFile does not exist.
    1>  -q                 :   if given, then SubWCRev will perform keyword
    1>                         substitution but will not show status on stdout.
    1>  
    1>  -f                 :   if given, then SubWCRev will include the
    1>                         last-committed revision of folders. Default is
    1>                         to use only files to get the revision numbers.
    1>                         this only affects $WCREV$ and $WCDATE$.
    1>  -e                 :   if given, also include dirs which are included
    1>                         with svn:externals, but only if they're from the
    1>                         same repository.
    1>  -E                 :   if given, same as -e, but it ignores the externals
    1>                         with explicit revisions, when the revision range
    1>                         inside of them is only the given explicit revision
    1>                         in the properties. So it doesn't lead to mixed
    1>                         revisions
    1>  
    1>  -x                 :   if given, then SubWCRev will write the revisions
    1>                         numbers in HEX instead of decimal
    1>  -X                 :   if given, then SubWCRev will write the revisions
    1>                         numbers in HEX with '0x' before them
    1>  
    1>  Switches must be given in a single argument, e.g. '-nm' not '-n -m'.
    1>  
    1>  SubWCRev reads the Subversion status of all files in a working copy
    1>  excluding externals. If SrcVersionFile is specified, it is scanned
    1>  for special placeholders of the form "$WCxxx$".
    1>  SrcVersionFile is then copied to DstVersionFile but the placeholders
    1>  are replaced with information about the working copy as follows:
    1>  
    1>  $WCREV$         Highest committed revision number
    1>  $WCREV&$        Highest committed revision number ANDed with the number
    1>                  after the &
    1>  $WCREV+$        Highest committed revision number added with the number
    1>                  after the &
    1>  $WCREV-$        Highest committed revision number subtracted with the
    1>                  number after the &
    1>  $WCDATE$        Date of highest committed revision
    1>  $WCDATE=$       Like $WCDATE$ with an added strftime format after the =
    1>  $WCRANGE$       Update revision range
    1>  $WCURL$         Repository URL of the working copy
    1>  $WCNOW$         Current system date & time
    1>  $WCNOW=$        Like $WCNOW$ with an added strftime format after the =
    1>  $WCLOCKDATE$    Lock date for this item
    1>  $WCLOCKDATE=$   Like $WCLOCKDATE$ with an added strftime format after the =
    1>  $WCLOCKOWNER$   Lock owner for this item
    1>  $WCLOCKCOMMENT$ Lock comment for this item
    1>  
    1>  
    1>  The strftime format strings for $WCxxx=$ must not be longer than 1024
    1>  characters, and must not produce output greater than 1024 characters.
    1>  
    1>  Placeholders of the form "$WCxxx?TrueText:FalseText$" are replaced with
    1>  TrueText if the tested condition is true, and FalseText if false.
    1>  
    1>  $WCMODS$        True if local modifications found
    1>  $WCMIXED$       True if mixed update revisions found
    1>  $WCEXTALLFIXED$ True if all externals are fixed to an explicit revision
    1>  $WCISTAGGED$    True if the repository URL contains the tags classification pattern
    1>  $WCINSVN$       True if the item is versioned
    1>  $WCNEEDSLOCK$   True if the svn:needs-lock property is set
    1>  $WCISLOCKED$    True if the item is locked
    1>  
    1>  Updating E:\ProjectWork\my jabberd2\jabberd-2.3.1\win32\include\version.wxi
    1>  SubWCRev 1.8.5, Build 25224 - 32 Bit 
    1>  
    1>  Usage: SubWCRev WorkingCopyPath [SrcVersionFile DstVersionFile] [-nmdf]
    1>  
    1>  Params:
    1>  WorkingCopyPath    :   path to a Subversion working copy.
    1>  SrcVersionFile     :   path to a template file containing keywords.
    1>  DstVersionFile     :   path to save the resulting parsed file.
    1>  -n                 :   if given, then SubWCRev will error if the working
    1>                         copy contains local modifications.
    1>  -N                 :   if given, then SubWCRev will error if the working
    1>                         copy contains unversioned items.
    1>  -m                 :   if given, then SubWCRev will error if the working
    1>                         copy contains mixed revisions.
    1>  -d                 :   if given, then SubWCRev will only do its job if
    1>                         DstVersionFile does not exist.
    1>  -q                 :   if given, then SubWCRev will perform keyword
    1>                         substitution but will not show status on stdout.
    1>  
    1>  -f                 :   if given, then SubWCRev will include the
    1>                         last-committed revision of folders. Default is
    1>                         to use only files to get the revision numbers.
    1>                         this only affects $WCREV$ and $WCDATE$.
    1>  -e                 :   if given, also include dirs which are included
    1>                         with svn:externals, but only if they're from the
    1>                         same repository.
    1>  -E                 :   if given, same as -e, but it ignores the externals
    1>                         with explicit revisions, when the revision range
    1>                         inside of them is only the given explicit revision
    1>                         in the properties. So it doesn't lead to mixed
    1>                         revisions
    1>  
    1>  -x                 :   if given, then SubWCRev will write the revisions
    1>                         numbers in HEX instead of decimal
    1>  -X                 :   if given, then SubWCRev will write the revisions
    1>                         numbers in HEX with '0x' before them
    1>  
    1>  Switches must be given in a single argument, e.g. '-nm' not '-n -m'.
    1>  
    1>  SubWCRev reads the Subversion status of all files in a working copy
    1>  excluding externals. If SrcVersionFile is specified, it is scanned
    1>  for special placeholders of the form "$WCxxx$".
    1>  SrcVersionFile is then copied to DstVersionFile but the placeholders
    1>  are replaced with information about the working copy as follows:
    1>  
    1>  $WCREV$         Highest committed revision number
    1>  $WCREV&$        Highest committed revision number ANDed with the number
    1>                  after the &
    1>  $WCREV+$        Highest committed revision number added with the number
    1>                  after the &
    1>  $WCREV-$        Highest committed revision number subtracted with the
    1>                  number after the &
    1>  $WCDATE$        Date of highest committed revision
    1>  $WCDATE=$       Like $WCDATE$ with an added strftime format after the =
    1>  $WCRANGE$       Update revision range
    1>  $WCURL$         Repository URL of the working copy
    1>  $WCNOW$         Current system date & time
    1>  $WCNOW=$        Like $WCNOW$ with an added strftime format after the =
    1>  $WCLOCKDATE$    Lock date for this item
    1>  $WCLOCKDATE=$   Like $WCLOCKDATE$ with an added strftime format after the =
    1>  $WCLOCKOWNER$   Lock owner for this item
    1>  $WCLOCKCOMMENT$ Lock comment for this item
    1>  
    1>  
    1>  The strftime format strings for $WCxxx=$ must not be longer than 1024
    1>  characters, and must not produce output greater than 1024 characters.
    1>  
    1>  Placeholders of the form "$WCxxx?TrueText:FalseText$" are replaced with
    1>  TrueText if the tested condition is true, and FalseText if false.
    1>  
    1>  $WCMODS$        True if local modifications found
    1>  $WCMIXED$       True if mixed update revisions found
    1>  $WCEXTALLFIXED$ True if all externals are fixed to an explicit revision
    1>  $WCISTAGGED$    True if the repository URL contains the tags classification pattern
    1>  $WCINSVN$       True if the item is versioned
    1>  $WCNEEDSLOCK$   True if the svn:needs-lock property is set
    1>  $WCISLOCKED$    True if the item is locked
    1>  
    1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:15.89
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Any idea how to fix this error? Thanks!

    Monday, March 10, 2014 11:00 AM

Answers

  • Hi,

    Thank you for posting here!

    In order to solve this error, please check the possible reason one by one.

    1. The path of your project may contains a Chinese char. Please do not have a Chinese char.

    2. Fix your pre/post build event script.

    3. It was may because there are some operation in customer built steps failed.

    In project properties, go to customer step, you can see there maybe some something in command line edit box. Open a windows promote and paste the command to it. Run, check if there is something wrong and fix it.

    If there is no command line in the project property custom built step, maybe you should check property of every single file of the project.

    If the command line has some macro, replace it with an actual value.

    Or you can echo the command in VS output window:

    • cd %(somedir)
    • echo %(somedir)

    You won't miss it that way. (refer to http://stackoverflow.com/questions/13118947/error-msb6006-cmd-exe-exited-with-code-1)

    I'm not familiar with your project. If they can not work for you, I suggest you pay attention to the information like " Switches must be given in a single argument, e.g. '-nm' not '-n -m'. ".

    Best regards,

    Sunny

    • Marked as answer by Anna Cc Tuesday, March 18, 2014 2:38 AM
    Tuesday, March 11, 2014 3:38 AM

All replies

  • I tried to migrate a CPP project from Visual studio 2008 to 2010 on Windows 7. I got the error MSB6006: "cmd.exe" exited with code 1. I suspect it has something to do with tortoiseSVN or subwcrev.exe, but I cannot figure out what.

    I looked through the internet and found related topics but none worked in my case. Below is the detailed information:

    1>------ Build started: Project: jabberd2, Configuration: Debug Win32 ------
    1>Build started 10-03-2014 12:27:23.
    1>InitializeBuildStatus:
    1>  Touching "Debug\jabberd2.unsuccessfulbuild".
    1>CustomBuild:
    1>  Updating E:\ProjectWork\my jabberd2\jabberd-2.3.1\win32\include\version.h
    1>  SubWCRev 1.8.5, Build 25224 - 32 Bit 
    1>  
    1>  Usage: SubWCRev WorkingCopyPath [SrcVersionFile DstVersionFile] [-nmdf]
    1>  
    1>  Params:
    1>  WorkingCopyPath    :   path to a Subversion working copy.
    1>  SrcVersionFile     :   path to a template file containing keywords.
    1>  DstVersionFile     :   path to save the resulting parsed file.
    1>  -n                 :   if given, then SubWCRev will error if the working
    1>                         copy contains local modifications.
    1>  -N                 :   if given, then SubWCRev will error if the working
    1>                         copy contains unversioned items.
    1>  -m                 :   if given, then SubWCRev will error if the working
    1>                         copy contains mixed revisions.
    1>  -d                 :   if given, then SubWCRev will only do its job if
    1>                         DstVersionFile does not exist.
    1>  -q                 :   if given, then SubWCRev will perform keyword
    1>                         substitution but will not show status on stdout.
    1>  
    1>  -f                 :   if given, then SubWCRev will include the
    1>                         last-committed revision of folders. Default is
    1>                         to use only files to get the revision numbers.
    1>                         this only affects $WCREV$ and $WCDATE$.
    1>  -e                 :   if given, also include dirs which are included
    1>                         with svn:externals, but only if they're from the
    1>                         same repository.
    1>  -E                 :   if given, same as -e, but it ignores the externals
    1>                         with explicit revisions, when the revision range
    1>                         inside of them is only the given explicit revision
    1>                         in the properties. So it doesn't lead to mixed
    1>                         revisions
    1>  
    1>  -x                 :   if given, then SubWCRev will write the revisions
    1>                         numbers in HEX instead of decimal
    1>  -X                 :   if given, then SubWCRev will write the revisions
    1>                         numbers in HEX with '0x' before them
    1>  
    1>  Switches must be given in a single argument, e.g. '-nm' not '-n -m'.
    1>  
    1>  SubWCRev reads the Subversion status of all files in a working copy
    1>  excluding externals. If SrcVersionFile is specified, it is scanned
    1>  for special placeholders of the form "$WCxxx$".
    1>  SrcVersionFile is then copied to DstVersionFile but the placeholders
    1>  are replaced with information about the working copy as follows:
    1>  
    1>  $WCREV$         Highest committed revision number
    1>  $WCREV&$        Highest committed revision number ANDed with the number
    1>                  after the &
    1>  $WCREV+$        Highest committed revision number added with the number
    1>                  after the &
    1>  $WCREV-$        Highest committed revision number subtracted with the
    1>                  number after the &
    1>  $WCDATE$        Date of highest committed revision
    1>  $WCDATE=$       Like $WCDATE$ with an added strftime format after the =
    1>  $WCRANGE$       Update revision range
    1>  $WCURL$         Repository URL of the working copy
    1>  $WCNOW$         Current system date & time
    1>  $WCNOW=$        Like $WCNOW$ with an added strftime format after the =
    1>  $WCLOCKDATE$    Lock date for this item
    1>  $WCLOCKDATE=$   Like $WCLOCKDATE$ with an added strftime format after the =
    1>  $WCLOCKOWNER$   Lock owner for this item
    1>  $WCLOCKCOMMENT$ Lock comment for this item
    1>  
    1>  
    1>  The strftime format strings for $WCxxx=$ must not be longer than 1024
    1>  characters, and must not produce output greater than 1024 characters.
    1>  
    1>  Placeholders of the form "$WCxxx?TrueText:FalseText$" are replaced with
    1>  TrueText if the tested condition is true, and FalseText if false.
    1>  
    1>  $WCMODS$        True if local modifications found
    1>  $WCMIXED$       True if mixed update revisions found
    1>  $WCEXTALLFIXED$ True if all externals are fixed to an explicit revision
    1>  $WCISTAGGED$    True if the repository URL contains the tags classification pattern
    1>  $WCINSVN$       True if the item is versioned
    1>  $WCNEEDSLOCK$   True if the svn:needs-lock property is set
    1>  $WCISLOCKED$    True if the item is locked
    1>  
    1>  Updating E:\ProjectWork\my jabberd2\jabberd-2.3.1\win32\include\version.wxi
    1>  SubWCRev 1.8.5, Build 25224 - 32 Bit 
    1>  
    1>  Usage: SubWCRev WorkingCopyPath [SrcVersionFile DstVersionFile] [-nmdf]
    1>  
    1>  Params:
    1>  WorkingCopyPath    :   path to a Subversion working copy.
    1>  SrcVersionFile     :   path to a template file containing keywords.
    1>  DstVersionFile     :   path to save the resulting parsed file.
    1>  -n                 :   if given, then SubWCRev will error if the working
    1>                         copy contains local modifications.
    1>  -N                 :   if given, then SubWCRev will error if the working
    1>                         copy contains unversioned items.
    1>  -m                 :   if given, then SubWCRev will error if the working
    1>                         copy contains mixed revisions.
    1>  -d                 :   if given, then SubWCRev will only do its job if
    1>                         DstVersionFile does not exist.
    1>  -q                 :   if given, then SubWCRev will perform keyword
    1>                         substitution but will not show status on stdout.
    1>  
    1>  -f                 :   if given, then SubWCRev will include the
    1>                         last-committed revision of folders. Default is
    1>                         to use only files to get the revision numbers.
    1>                         this only affects $WCREV$ and $WCDATE$.
    1>  -e                 :   if given, also include dirs which are included
    1>                         with svn:externals, but only if they're from the
    1>                         same repository.
    1>  -E                 :   if given, same as -e, but it ignores the externals
    1>                         with explicit revisions, when the revision range
    1>                         inside of them is only the given explicit revision
    1>                         in the properties. So it doesn't lead to mixed
    1>                         revisions
    1>  
    1>  -x                 :   if given, then SubWCRev will write the revisions
    1>                         numbers in HEX instead of decimal
    1>  -X                 :   if given, then SubWCRev will write the revisions
    1>                         numbers in HEX with '0x' before them
    1>  
    1>  Switches must be given in a single argument, e.g. '-nm' not '-n -m'.
    1>  
    1>  SubWCRev reads the Subversion status of all files in a working copy
    1>  excluding externals. If SrcVersionFile is specified, it is scanned
    1>  for special placeholders of the form "$WCxxx$".
    1>  SrcVersionFile is then copied to DstVersionFile but the placeholders
    1>  are replaced with information about the working copy as follows:
    1>  
    1>  $WCREV$         Highest committed revision number
    1>  $WCREV&$        Highest committed revision number ANDed with the number
    1>                  after the &
    1>  $WCREV+$        Highest committed revision number added with the number
    1>                  after the &
    1>  $WCREV-$        Highest committed revision number subtracted with the
    1>                  number after the &
    1>  $WCDATE$        Date of highest committed revision
    1>  $WCDATE=$       Like $WCDATE$ with an added strftime format after the =
    1>  $WCRANGE$       Update revision range
    1>  $WCURL$         Repository URL of the working copy
    1>  $WCNOW$         Current system date & time
    1>  $WCNOW=$        Like $WCNOW$ with an added strftime format after the =
    1>  $WCLOCKDATE$    Lock date for this item
    1>  $WCLOCKDATE=$   Like $WCLOCKDATE$ with an added strftime format after the =
    1>  $WCLOCKOWNER$   Lock owner for this item
    1>  $WCLOCKCOMMENT$ Lock comment for this item
    1>  
    1>  
    1>  The strftime format strings for $WCxxx=$ must not be longer than 1024
    1>  characters, and must not produce output greater than 1024 characters.
    1>  
    1>  Placeholders of the form "$WCxxx?TrueText:FalseText$" are replaced with
    1>  TrueText if the tested condition is true, and FalseText if false.
    1>  
    1>  $WCMODS$        True if local modifications found
    1>  $WCMIXED$       True if mixed update revisions found
    1>  $WCEXTALLFIXED$ True if all externals are fixed to an explicit revision
    1>  $WCISTAGGED$    True if the repository URL contains the tags classification pattern
    1>  $WCINSVN$       True if the item is versioned
    1>  $WCNEEDSLOCK$   True if the svn:needs-lock property is set
    1>  $WCISLOCKED$    True if the item is locked
    1>  
    1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:15.89
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Any idea how to fix this error? Thanks!

    • Merged by Anna Cc Tuesday, March 11, 2014 2:05 AM same case
    Monday, March 10, 2014 11:02 AM
  • Hi,

    Thank you for posting here!

    In order to solve this error, please check the possible reason one by one.

    1. The path of your project may contains a Chinese char. Please do not have a Chinese char.

    2. Fix your pre/post build event script.

    3. It was may because there are some operation in customer built steps failed.

    In project properties, go to customer step, you can see there maybe some something in command line edit box. Open a windows promote and paste the command to it. Run, check if there is something wrong and fix it.

    If there is no command line in the project property custom built step, maybe you should check property of every single file of the project.

    If the command line has some macro, replace it with an actual value.

    Or you can echo the command in VS output window:

    • cd %(somedir)
    • echo %(somedir)

    You won't miss it that way. (refer to http://stackoverflow.com/questions/13118947/error-msb6006-cmd-exe-exited-with-code-1)

    I'm not familiar with your project. If they can not work for you, I suggest you pay attention to the information like " Switches must be given in a single argument, e.g. '-nm' not '-n -m'. ".

    Best regards,

    Sunny

    • Marked as answer by Anna Cc Tuesday, March 18, 2014 2:38 AM
    Tuesday, March 11, 2014 3:38 AM