在Visual Studio Post-build事件中删除整个文件夹

jsm*_*ars 10 visual-studio-2010 post-build-event visual-studio

我正在尝试使用以下命令行删除输出目录中的文件夹:

del /F "$(TargetDir)Content\"
Run Code Online (Sandbox Code Playgroud)

我总是最终退出错误代码1.我尝试了几种不同的方式,没有/ F,前后都有/没有斜线等.

Error   1   The command "del /F "E:\proj\bin\Windows\Debug\Content\"" exited with code 1.
Run Code Online (Sandbox Code Playgroud)

关于在visual studio中的后期构建事件命令行中删除文件有很多问题,它工作正常,但我似乎无法删除文件夹而不获取代码1.

任何帮助表示赞赏!

Ser*_*gan 14

RD /S /Q "Full Path of Folder"
Run Code Online (Sandbox Code Playgroud)

在你的情况下:

RD /S /Q "$(TargetDir)Content\"
Run Code Online (Sandbox Code Playgroud)