Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to create a batch file that do following:
For example program name is hi.exe will do the following:

  1. Run hi.exe in cmd with arguments hi.exe -f%l%.
  2. Instead of %1% I want user to input the number of his choice.
share|improve this question

1) You do not need to open a cmd window separately. You can use start command followed by path of exe. Check here:

2) To read arguments you can use a statement like: set /p name= What is your name? which prompts user with question "What is your name?" and accepts the input in variable 'p'. Check here for more:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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