" cmd.exe的"无法运行。 [英] "cmd.exe" could not be run.

查看:134
本文介绍了" cmd.exe的"无法运行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天安全部门正在搞乱迈克菲设置,突然之间我无法构建我的解决方案。我有以下一个错误:


指定的任务可执行文件"cmd.exe"无法运行。 System.IO.IOException:无法创建临时文件。临时文件文件夹已满或其路径不正确。访问路径'C:\Users\hsimpson\AppData\Local\Temp\tmp77de4b0230e0494787ccfe80380a149a.exec.cmd'
被拒绝。 ---> System.UnauthorizedAccessException:拒绝访问路径'C:\Users\hsimpson \ AppData \ Local \Temp \ tmp77de4b0230e0494787ccfe80380a149a.exec.cmd'。

  在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)

   在System.IO.StreamWriter.CreateFile(String path,Boolean append,Boolean checkHost)

  在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)

   ---内部异常堆栈跟踪结束---

   at Microsoft.Build.Shared.FileUtilities.GetTemporaryFile(String directory,String extension,Boolean createFile)

  在Microsoft.Build.Tasks.Exec.CreateTemporaryBatchFile()

  在Microsoft.Build.Tasks.Exec.AddCommandLineCommands(CommandLineBuilderExtension commandLine)

  在Microsoft.Build.Tasks.ToolTask​​Extension.GenerateCommandLineCommands()

  在Microsoft.Build.Utilities.ToolTask​​.Execute()  SaleSuggestions   


还创建了另一个文件,其中包含:


来自流程22552的未处理的异常:

=====================

5/31/2019 7:54:20 AM

System.IO.IOException:管道坏了。

  在System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)

   at System.IO.Pipes.PipeStream.BeginWriteCore(Byte [] buffer,Int32 offset,Int32 count,AsyncCallback callback,Object state)

  在System.IO.Pipes.PipeStream.WriteCore(Byte []缓冲区,Int32偏移量,Int32计数)

  在System.IO.Pipes.PipeStream.Write(Byte []缓冲区,Int32偏移量,Int32计数)

  在Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe,Stream localWritePipe,ConcurrentQueue`1 localPacketQueue,AutoResetEvent localPacketAvailable,AutoResetEvent localTerminatePacketPump)

============== =====


我清理了Temp文件但没有帮助。 这就像是仍然存在权限错误。


任何想法? 遇到此问题的其他人?

解决方案

嗨含羞草,


欢迎来到MSDN论坛。


请检查
此主题
,也许你可以从中得到一些帮助。


并且请确认您已获得当前用户帐户的"管理"权限。删除.vs,bin和obj文件夹(在
备份后之后),以管理员身份运行VS并重建解决方案。


此外,您还可以try命令:  del / F / S / Q%TEMP%\ tmp * .tmp快速清理临时文件。根据问题,也许你可以从 C:\ WINDOWS \Temp 和  C:\ Users \ hsimpson \ AppData \ Local \Temp


希望以上所有有帮助。如果它有用或有帮助,请告诉我。


最好的问候


Lance


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?

解决方案

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


这篇关于" cmd.exe的"无法运行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆