How can I delete a file in C# e.g. C:\\test.txt, although apply the same kind of method like in batch files e.g.
C:\\test.txt
if exist \"C:\\test.txt\" dele
Use System.IO.File.Delete like so:
System.IO.File.Delete(@"C:\test.txt")
From the documentation:
If the file to be deleted does not exist, no exception is thrown.