How to execute "del data.txt" using Process?
<p>The following trivial code is just an example that does not reflect my real scenario. 
I have tried it and it did not work. </p>

<p>I want to delete <code>data.txt</code> using <code>Process</code> rather than using <code>File</code> class.</p>

<pre><code>using System;
using System.Diagnostics;

namespace Tester
{
    class Program
    {
        static void Main(string[] args)
        {
            Process p = new Process();
            p.StartInfo.FileName = "cmd";
            p.StartInfo.Arguments = "del data.txt";
            p.StartInfo.UseShellExecute=false;
            p.EnableRaisingEvents = true;
            p.Exited += (sender, e) =&gt; { Console.WriteLine("Finished"); };

            p.Start();
            p.WaitForExit();
        }
    }
}
</code></pre>

<p>How to execute <code>del data.txt</code> using <code>Process</code>?</p>
