Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting entire folder in Visual Studio Post-build event

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

del /F "$(TargetDir)Content\"

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

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

There are a lot of questions regarding deleting files in post-build event command lines in visual studio, which works fine, but I can't seem to delete a folder without getting code 1.

Any help is appreciated!

like image 512
jsmars Avatar asked May 28 '15 22:05

jsmars


1 Answers

RD /S /Q "Full Path of Folder"

In your case:

RD /S /Q "$(TargetDir)Content\"
like image 85
Sergey Kulgan Avatar answered Oct 29 '22 00:10

Sergey Kulgan