I have a small problem with filtering the first 1 second of a Pcap file and export it Via C# command. The command below execute just fine in CMD:
c:\Program Files\Wireshark\tshark.exe -r 10Secfile.pcap -T fields -E separator=, -E quote=d -e wlan_mgt.fixed.timestamp -e radiotap.mactime -e wlan_mgt.ssid -e radiotap.dbm_antsignal -e wlan.fc.type_subtype -R "frame.time_relative <=1.0" >> 1SecFile.txt
But when I try to do the exact same thing in C# like this:
strCmdText = "/C \"c:\\Program Files\\Wireshark\\tshark.exe\" -r 10SecFile.pcap -T fields -E separator=, -E quote=d -e wlan_mgt.fixed.timestamp -e radiotap.mactime -e wlan_mgt.ssid -e radiotap.dbm_antsignal -e wlan.fc.type_subtype -R \"frame.time_relative <=1.0\" >> 1SecFile.txt";
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo = new System.Diagnostics.ProcessStartInfo("CMD.exe", strCmdText);
process.Start();
process.WaitForExit();
I get this error: "the system cannot find the file specified command". And I am sure that all the paths to executables are found because the code works as soon as I remove the last filter:
-R \"frame.time_relative <=1.0\"
I even placed a breakpoint after "strCmdText=" and copied the value of it manually and pasted it into CMD and it works just fine.
I really appreciate if you help me to figure this out.