How can I delete all files and folders from a given path?
I tried this, but I'm unable to select the directories.
<Target Name="CleanSource" Condition="$(path)!=''">
<Message Text="path=$(path)"/>
<ItemGroup>
<fileToDelete Include="$(path)\**\*.*" />
<directoryToDelete Include="$(path)\**\" /><!these doest not select any directory at all-->
</ItemGroup>
<Message Text="file to delete:@(fileToDelete)"/>
<Message Text="directory to delete:@(directoryToDelete)"/>
<Delete Files="@(fileToDelete)" />
<Message Text="file effectively deleted:@(DeletedFiles)"/>
<RemoveDir Directories="@(directoryToDelete)" />
<Message Text="Directory effectively deleted:@(RemovedDirectories)"/>
</Target>