3 Replies - 2070 Views - Last Post: 17 January 2012 - 10:19 PM Rate Topic: ***** 1 Votes

#1 QuestExpert  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-January 12

Passing Parameters from Excel to run a batch [.bat] file

Posted 17 January 2012 - 01:40 PM

Problem: [The code I am running is not the part of actual ETL] so for multiple DB environments I need to run single job [for Mock Conversions rejected data] and for each environment I have to manually update the parameters in the param file before running the job. my job takes all the parameters for running the job like "DB Host[Server]", "DB Schema", "DB_User" etc

Question: is there a way that anybody can run the job by simply passing the parameter values from excel file [people heat to do changes in param file and running from cmd causing so many failures e.g path is not correctly define, missing a parameter etc]

What I am trying to do is below:

have a Nice little Excel spreadsheet with all the parameters and their values for example.
Parameter | Value
DB_Schema | Application
DB_User | Scott
DB_Passwd | Tiger
... | ...

and a 'Button' to "Execute" the job.
Now on pressing the Execute button I want to pass the Values from the above list to my .bat file to run.

Hope I clear my question.

Thanks in Advance.

Is This A Good Question/Topic? 0
  • +

Replies To: Passing Parameters from Excel to run a batch [.bat] file

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Passing Parameters from Excel to run a batch [.bat] file

Posted 17 January 2012 - 07:46 PM

Do you already have your batch file set up with % parameters? Show me how you would execute it from a command line.
Was This Post Helpful? 0
  • +
  • -

#3 QuestExpert  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-January 12

Re: Passing Parameters from Excel to run a batch [.bat] file

Posted 17 January 2012 - 09:31 PM

Hi Bob,
my .bat can be run like c:\RunBatch.bat Param1='Value1' Param2='Value2' Param3='Value3'

Thanks

View PostBobRodes, on 17 January 2012 - 07:46 PM, said:

Do you already have your batch file set up with % parameters? Show me how you would execute it from a command line.

Was This Post Helpful? 0
  • +
  • -

#4 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Passing Parameters from Excel to run a batch [.bat] file

Posted 17 January 2012 - 10:19 PM

look up "vb6 shell". It will do what you want.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1