none
"cmd.exe" could not be run. RRS feed

  • Question

  • Yesterday security was messing around with McAfee settings and all of a sudden I could not build my solution. I had the following one error:

    The specified task executable "cmd.exe" could not be run. System.IO.IOException: Failed to create a temporary file. Temporary files folder is full or its path is incorrect. Access to the path 'C:\Users\hsimpson\AppData\Local\Temp\tmp77de4b0230e0494787ccfe80380a149a.exec.cmd' is denied. ---> System.UnauthorizedAccessException: Access to the path 'C:\Users\hsimpson\AppData\Local\Temp\tmp77de4b0230e0494787ccfe80380a149a.exec.cmd' is denied.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
       at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
       at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
       at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
       at System.IO.File.WriteAllText(String path, String contents)
       at Microsoft.Build.Shared.FileUtilities.GetTemporaryFile(String directory, String extension, Boolean createFile)
       --- End of inner exception stack trace ---
       at Microsoft.Build.Shared.FileUtilities.GetTemporaryFile(String directory, String extension, Boolean createFile)
       at Microsoft.Build.Tasks.Exec.CreateTemporaryBatchFile()
       at Microsoft.Build.Tasks.Exec.AddCommandLineCommands(CommandLineBuilderExtension commandLine)
       at Microsoft.Build.Tasks.ToolTaskExtension.GenerateCommandLineCommands()
       at Microsoft.Build.Utilities.ToolTask.Execute() SaleSuggestions   

    There was another file too created and it contained:

    UNHANDLED EXCEPTIONS FROM PROCESS 22552:
    =====================
    5/31/2019 7:54:20 AM
    System.IO.IOException: Pipe is broken.
       at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
       at System.IO.Pipes.PipeStream.BeginWriteCore(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
       at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
       at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)
    ===================

    I cleaned up the Temp file and that didn't help.  It's like there is still a permissions error.

    Any Ideas?  Anyone else running into this McAfee issue?

    Friday, May 31, 2019 1:17 PM

All replies

  • Hi Mimosa,

    Welcome to MSDN forum.

    Please check this thread, maybe you can get some help from it.

    And please confirm that you've got the Administration permission with the current user account. Delete the .vs, bin and obj folder(after backup them), run VS as admin and rebuild the solution.

    Also, you can try command: del /F /S /Q %TEMP%\tmp*.tmp to quickly cleanup the temp files. And according to the issue, maybe you can delete both temp files from C:\WINDOWS\Temp and C:\Users\hsimpson\AppData\Local\Temp.

    Hope all above helps. If it's helpful or not, please let me know.

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Monday, June 3, 2019 6:38 AM
  • Thanks Lance,

    Turns out that I had some post build event commands that were causing the trouble.  I made sure that the required reference files were available in the program directory and deleted the post build script commands and it rebuilt just fine.

    Again thanks for the response Lance.

    Harry

    Wednesday, June 5, 2019 12:28 PM
  • Glad to know it's solved. And thanks for sharing your workaround to solve it, you can consider marking it as answer so that other members with similar issue could easily find it.

    Have a nice day!


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 6, 2019 1:38 AM