2

Using Windows 7, I want to write a wrapper for some command line tools to simplify their usage. Say I regularly use this executable with following options

someTool.exe -i infile -a option1 -b option2

I want to create a wrapper that executes the above command & options, and additionally accept more options (any number of options). So running this:

someToolWrapper.exe -c option3

would effectively run

someTool.exe -i infile -a option1 -b option2 -c option3

P.S. Preferably accomplish this with batch files or cygwin commands & be robust / versatile. I usually end up with brittle batch files that fail on edge cases.

1
  • 1
    I would do this using Powershell.
    – rrirower
    Commented Dec 28, 2014 at 19:38

1 Answer 1

7

SomeToolWrapper.bat:

someTool.exe -i infile -a option1 -b option2 -c %1

Run:

SomeToolWrapper.bat option3
1
  • 6
    %* instead of %1 would make it generic (allows variable number of options)
    – user
    Commented Dec 28, 2014 at 19:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .