Jump to content
Sign in to follow this  
Maxwin

Read from an array and concatenate

Recommended Posts

Maxwin

I am totally new to AutoIT, need a small help. Currently, Iam trying to automate the work which i do everyday manually so as to save time.

In the code here below, I am have launch a program called as Wireshark in cmd prompt.

A folder present on C drive has many pcaps (kind of files that Wireshark understands).

The help that i required is i want to send the contents (files) of the folder to (example)

Example: Send("tshark.exe -r C;\Rtfpcaps\google.rtf.pcap)

For this i had listed all the files in an Array but when i pop them out i cannot get them in the format as shown in the example stated above.

PS: Array has many pcaps:- google,7f56ce915dc6be782681464cc62a6588.rtf.pcap,

7f5d3c5ab6621bbacde0c14719d2e0c7.rtf.pcap,8cf4cb2bd4531c82c57b81abb293be86.rtf.pcap.etc

Thanks for the help in advance

#include<File.au3>

#include<Array.au3>

Run("cmd")

WinWaitActive("C:\WINDOWS\system32\cmd.exe")

send("Cd C:\Program Files\Wireshark")

send("{Enter}")

$a=_FileListToArray("C:\Rtfpcaps")

While UBound($a)

Send("tshark.exe -r C:\Rtfpcaps\")

_ArrayPop($a)

send("{Enter}")

WEnd

Share this post


Link to post
Share on other sites
water

Can't you use function

Run("C:\Program Files\Wireshark\tshark.exe -r " & <Your filename goes here>, "C:\Rtfpcaps")
for every file you need to process?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Maxwin

Thank for you rpompt reply, but this won't work.

There are 2000 Pcaps files

Share this post


Link to post
Share on other sites
water

What I mean is:

If you can process one file as I described above then you can process them all.

Populate an array with all the files you need to process (as you ahve done with _FileListToArray) and then loop throught the array and process one by one.

I would replace Run with RunWait so not to start 2000 processes at the same time.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×