#1 08 Nov 2017 12:57

Suhail_07
New Member
Registered: 08 Nov 2017
Posts: 2

To do a set of tasks using batch file taking input from excel file

Hi,
I have a set of tasks to be run at different times of a day & at different days. I wanted to schedule it using a batch file which reads the date, time and file path from excel file and run the tasks also send emails after the task is completed or any failures have occurred
Can anyone suggest any code snippet?

I’ve the sample of the excel file below
File name|| File Path|| Date ||Timing|| Email Id
abc || C:\Projects\expensesworkflow.yxmd|| 8nov2017,10Nov2017,17Nov2017|| 16:30, 17:10, 20:05|| xyz@gmail.com, sgfc@gmail.com
bcdf || C:\Projects\censusworkflow.yxmd|| 9nov2017,11Nov2017,15Nov2017|| 12:30, 14:05, 19:05|| sgfc@gmail.com , xyz@gmail.com
fghi || C:\Projects\profitworkflow.yxmd|| 17nov2017,11Nov2017,15Nov2017|| 12:30, 14:05, 19:05|| sgfc@gmail.com , xyz@gmail.com

Offline

#2 09 Nov 2017 06:26

Shadow Thief
Member
Registered: 12 Jul 2012
Posts: 157

Re: To do a set of tasks using batch file taking input from excel file

XLS files can't be read by batch scripts. If your data is in a CSV file, this is possible; otherwise, I'd recommend using VBA.

Also, I have no idea what your sample data is trying to say.

Offline

#3 09 Nov 2017 11:12

Suhail_07
New Member
Registered: 08 Nov 2017
Posts: 2

Re: To do a set of tasks using batch file taking input from excel file

Thanks Shadow,

I have no knowledge on VBA so, could you suggest me how is that possible?

Offline

#4 09 Nov 2017 11:46

Pyprohly
Member
Registered: 26 Nov 2014
Posts: 9

Re: To do a set of tasks using batch file taking input from excel file

Yeah, Batch is not an option. Batch files can’t read Excel spreadsheets, nor do they have the ability to send emails on their own unlike in VBScript or PowerShell.

If you switch to either of these languages instead I might be able to help with parts of your project, Suhail_07, but unless you can provide accurate test data for us to peruse (such as a sample of the Excel spreadsheet and also a XML formatted template of the required scheduled task) you’ll need to be somewhat accustomed to writing in which ever of those languages you choose.

Offline

Board footer

Powered by FluxBB