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
    I would do this using Powershell. – rrirower Dec 28 '14 at 19:38
6

SomeToolWrapper.bat:

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

Run:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.