I want to convert .pcapng files to .csv files using the below commands:
> cd C:\Program Files\Wireshark
> tshark -r output.pcapng -T fields -e frame.number -e eth.src -e eth.dst -e frame.len -e frame.time -e frame.time_relative -e data -E header=y -E separator=, > output.csv
In C#, I used the following code.
string command = @"cd C:\Program Files\Wireshark & tshark -r output.pcapng -T fields -e frame.number -e eth.src -e eth.dst -e frame.len -e frame.time -e frame.time_relative -e data -E header=y -E separator=, > output.csv";
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "CMD.exe";
startInfo.Arguments = command;
startInfo.Verb = "runas";
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();
This doesnt seem to be working.
Neil :
Check that path:\n\nstring command = @\"cd C:\\ProgramFiles\\Wireshark & tshark -r output.pcapng -T fields -e frame.number -e eth.src -e eth.dst -e frame.len -e frame.time -e frame.time_relative -e data -E header=y -E separator=, > output.csv\";\n\nOn my machine, Program Files has a space between the two words, and Wireshark & tshark is suspicious too. Ampersand (especially when using shells) is interpreted differently.",
2020-03-11T14:53:49