Batch file, read data in email, open browser

July 21, 2009 at 16:47:58
Specs: Windows Vista/XP

Hi there,

I am looking for a way to automate a tedious task I have to go through every day at work, and I thought a batch file might be the way to go about it.

I am in sales, and every morning I get an automated email that lists all the orders I processed 2 days ago, the idea being that I use this email to check each order and make sure it has been successfully ordered by our purchasing team and despatched.

What I would need the batch file to do would be to pick out the order numbers from within the email (this could be anywhere between 5 and 40 orders depending on how busy I was 2 days ago) and then use that order number to open the orders very own page on our intranet, which tells me whether it has gone, or whether it is still on backorder.

The email in question is always in the same format, the order numbers can always be found after the text "Sage No:" then 3 tabs across and then the order number is a 6 digit number.

For each order number in the email I would want to open, for example, the following web address:

http://intranet/reports/mycompany/f...

So running this batch file would essentially open up 5-40 pages at once (all text, no pictures, so not a huge hit on the bandwidth).

I was thinking I could set an outlook rule to run this batch file whenever I get that particular email or to run at a specific time each day.

Step 2 of this process would be noting which part codes on each of the orders are still showing as being on backorder, copying the part code(s) and either

a) using those part codes to open another page on the intranet, similar to the last one, but with the part code in the URL instead of the 6 digit order number or

b) Opening another page on the intranet, pasting the part number into a text field and clicking the submit button

Even if step 2 can't be done, step 1 would be a great help.


Is this all too much to expect out of batch files, or a series of batch files?


See More: Batch file, read data in email, open browser

Report •


#1
July 21, 2009 at 19:15:18

Is this all too much to expect out of batch files, or a series of batch files?"

For the most part yes.

Emails are normally stored in a binary format by the email program (I don't use outlook but I think does), batch doesn't handle most non-printable characters so well. Unless you can setup a rule to export as plain text to a specific folder automatically you may have to do that part manually.

Without seeing the format of the emails(as they would be exported as plain text) then it's hard to say how feasible the rest would be.

[edit]
I just reread your post and noticed that you also want to scrape information from a web page, you would also need a third party utility like wget to accomplish this in batch.
[/edit]


Report •

#2
July 21, 2009 at 19:31:04

Assuming the output you have to scrape is fairly regular, you could do it in VBScript.

I don't have Outlook installed, so I must sit this one out.


Report •

Related Solutions


Ask Question