Deleting files on a remote computer
If you cannot get to the network share, you can create a batch file for remote execution.
So remove.bat
c:\
cd \Windows\system32\example\
rm *
and use psexec to copy the bat to the remote machine and execute it there.
psexec \\example-computer -f -c remove.bat
After the exit psexec bit is complete on the remote computer.
psexec uses netbios, so you should be able to initiate a netbios session on the remote machine.
source to share
If it's a computer on your local network or VPN, you can use a UNC path, but you need to know each username and password. You will need to use the WNetUseConnection Win32 API from C # to connect to your computer. Once connected, you can delete files in the usual way. Just provide the full UNC path to the file \\machine\c$\file.txt
.
If the machine is on a network rather than a local network or VPN, WCF sounds like you are looking for. You can create a service contract with a file delete operation. There is a huge introduction to WCF Services here .
source to share