0

I want to delete files kept in a shared folder on a remote machine using msbuild. I have googled but couldn't get a proper solution. Please help.

Thank you

abhi
  • 368
  • 1
  • 4
  • 14
SharpCoder
  • 18,279
  • 43
  • 153
  • 249

2 Answers2

0

To answer my own question: Following code is working.

<ItemGroup>
        <ServiceLocation Include="\\ServerName\FolderName\*.*"></ServiceLocation>
      </ItemGroup>

    <Target Name="Deploy">
    <Delete Files="@(ServiceLocation)" />
    </Target>
SharpCoder
  • 18,279
  • 43
  • 153
  • 249
-1

try with this one,

<Target Name="SomeTarget">

<ItemGroup>
    <FilesToDelete Include="Path\To\Obj\**\*"/>
</ItemGroup>

<Delete Files="@(FilesToDelete)" />

</Target>
abhi
  • 368
  • 1
  • 4
  • 14