Deleting entire folder in Visual Studio Post-build event

I am trying to delete a folder in my output directory using the following command line:

del /F "$(TargetDir)Content\"

      

Tho I always end up with error code 1. I've tried several different ways, without / F, with / without forward slash both before and after, etc.

Error   1   The command "del /F "E:\proj\bin\Windows\Debug\Content\"" exited with code 1.

      

There are many questions regarding deleting files in post build event command lines in visual studio that work great, but I cannot delete the folder without getting code 1.

Any help is appreciated!

+3


source to share


2 answers


RD /S /Q "Full Path of Folder"

      

In your case:



RD /S /Q "$(TargetDir)Content\"

      

+5


source


Go to the same folder using command line and then run this command and see what the actual error is. There may be permissions or something to use.



+2


source







All Articles