I have made a batch file (auto.bat) as follows:
cd C:\Program Files (x86)\Wireshark
tshark -i 3 -w "C:\Users\V ivek Ganti\pcap_file .pcap"
tshark -nr "C:\Users\V ivek Ganti\pcap_file .pcap" -T text > "C:\Users\V ivek Ganti\myoutput. txt"
This is basically to start Wireshark, sniff packets, save it on a pcap file, and then export it to a text file so i can later parse the file.
When i run "auto.bat" from the cmd prompt, it runs great- stores the pcap file and the exported text file.
But when i do os.system("auto .bat") or subprocess.call ("auto.bat") , it does not store the pcap file or the exported txt file. On the Python shell i get a return code of 0 (though the command window opens and captures packets- just doesnt save them in a file).
Please help.
Thank you very much,
Vivek
cd C:\Program Files (x86)\Wireshark
tshark -i 3 -w "C:\Users\V ivek Ganti\pcap_file .pcap"
tshark -nr "C:\Users\V ivek Ganti\pcap_file .pcap" -T text > "C:\Users\V ivek Ganti\myoutput. txt"
This is basically to start Wireshark, sniff packets, save it on a pcap file, and then export it to a text file so i can later parse the file.
When i run "auto.bat" from the cmd prompt, it runs great- stores the pcap file and the exported text file.
But when i do os.system("auto .bat") or subprocess.call ("auto.bat") , it does not store the pcap file or the exported txt file. On the Python shell i get a return code of 0 (though the command window opens and captures packets- just doesnt save them in a file).
Please help.
Thank you very much,
Vivek
Comment