I'm trying to run the tshark exe with a bunch of options and outputting to a fil (see below). However I'm really stuck on the correct syntax of the system() command to use.
I've had help on here previously and have since even gotten it working with a dos for loop, however this is beyond me. I've tried a variety of escape sequences and encapsulating the whole command in 2-3 quotes, as per other suggestions I've seen on SO.
The command is:
C:\Program Files\Wireshark\tshark.exe -a duration:130 -i 3 -T fields -e frame.number -e frame.time -e _ws.col.Info > c:\test\output.csv
I've tried:
system("start C:\\Program\ Files\\Wireshark\\tshark.exe -a duration:130 -i 3 -T fields -e frame.number -e frame.time -e _ws.col.Info > c:\\test\\tshark2.csv &");
system("\"start C:\\Program\ Files\\Wireshark\\tshark.exe -a duration:130 -i 3 -T fields -e frame.number -e frame.time -e _ws.col.Info\" > c:\\test\\tshark2.csv &");
...amongst others.
If it weren't for the space in the dir I could be past this I think. Is it easier to change into the dir to run tshark? Also, the advice I've had up to now is to use "start" in system calls, if this is wrong please feel free to say.
Apologies for the questions but I only came into C++ recently and I'm still getting used to some things...
I should have added that I'm also trying to get this to run as a background job and for the rest of my script to continue while it runs.