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, 2014 at 19:38

1 Answer 1



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


SomeToolWrapper.bat option3
  • 6
    %* instead of %1 would make it generic (allows variable number of options)
    – user
    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 .