locked
error 9009 using command attrib - error MSB3073 RRS feed

  • Question

  • Hi all,

    I have problem when execute targets file using MSBUILD. I'm using vs 2008, .net 3.5, win xp.

    Fails in PC of other person in LAN, in my PC works fine.

    The error: Command attrib exits with code 9009

    ERROR al generar.

    C:\WINDOWS\TEMP\Instalacion_ProyectoRealeCTIAltitude1\ScriptDespliegue.Targets(128,5): error MSB3073: El comando "attrib -R "C:\Temp\Reale\localhost\alt_scripts\doc_args\*.*" /S /D" salió con el código 9009.

    The code

     

    <

     

    Target Name="CopiarDocumentosPdfParaAgentes" Condition="'$(RealizaCopiaEjecucion)' == 'SI'">

    <

    Microsoft.Sdc.Tasks.Folder.CopyFolder Source="DocumentosPdfParaAgentes" Destination="$(RutaDestinoDocumentosParaAgentes)" />

    <

     

    Exec Command="attrib -R &quot;$(RutaDestinoDocumentosParaAgentes)\*.*&quot; /S /D" IgnoreExitCode="false" />

    </

     

    Target>

    Appreciate your feedback and help on this. Any suggestions?
    Thanks in advance..


    Should "Hi", "Thanks" and taglines and salutations be removed from posts? http://meta.stackoverflow.com/questions/2950/should-hi-thanks-and-taglines-and-salutations-be-removed-from-posts
    Thursday, July 22, 2010 6:35 AM

Answers

  • "9009 is cmd.exe's way of saying "blah is not an executable program" etc. It can't find the tool." -- http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/8e37fa7d-dce9-4650-9380-43fc6dcc386c/

    The fact this is happening with attrib is odd. Perhaps they have a corrupted system32 folder. On the machine where is doesn't work, try typing "where attrib" in a command prompt and see if it finds it. If it can't find it then see if it is located in C:\WINDOWS\system32. If it is in there then you Path environment variable is wrong as it should have this folder in it. You could add it back in. If for some reason you have attrib in a different location on the pc, then set the WorkingFolder property for the exec command, e.g. 

    <Exec Command="attrib -R &quot;$(RutaDestinoDocumentosParaAgentes)\*.*&quot; /S /D" IgnoreExitCode="false" WorkingDirectory="thefolderwhereattribislocated"/>
    
     
    


    Visual Studio ALM MVP
    My Blog | MSBuild Extension Pack | MSBuild Explorer
    • Proposed as answer by Chao Kuo Friday, July 23, 2010 3:12 AM
    • Marked as answer by Chao Kuo Thursday, July 29, 2010 2:33 AM
    Thursday, July 22, 2010 7:40 AM