How to run Outlook Rule that fires a batch script that requires passing parameters.

How do I pass arguments/parameters to a batch script in an Outlook rule ?  The Parameters would be located in the body of the message.

Thanks.


  • Edited by BluestoneBeach Tuesday, November 04, 2014 2:24 PM Poorly worded description
November 3rd, 2014 6:38pm

Hi,

If the two arguments are always next to each other, then we can simply add that single phrase to the specific words list.

If the two arguments are not always next to each other, then there is no way in Outlook to do this with a single rule but we can achieve this by creating 2 rules. See:

http://www.msoutlook.info/question/220

Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

Regards,

Steve Fan
TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
November 4th, 2014 5:21am

Thank you Mr. Fan for your reply. I realized that my question was not worded correctly. I re-wrote the entire question. Basically, I want to know how to pass parameters/arguments to a batch script. The parameters would be located in the body of the message.

Thank you.

 
November 4th, 2014 2:34pm

Well there is no possible way to pass an argument to a batch file using the Rules GUI in Outlook so I had to resort to VBA coding to handle this task.  This link got me 85% of what I needed.

How to process incoming messages

 
Free Windows Admin Tool Kit Click here and download it now
November 6th, 2014 11:29pm

@Bluestone, Could you share your vb script that got you to run a bat file and pass arguments? I am very novice at vb script writing but need to do the following:

send myself a specific email and run  the contents of whatever i place in the body of the email.

eg:

subject: restart server

body:

shutdown \\server1 /r

or

c:\mystuff\restartapp.bat app1 bill force 10

March 13th, 2015 11:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics