A few words of thanks would be greatly appreciated.

Launch a .exe file from a .bat file


I would like to make a batch file that launches a .exe file that takes a value as input and return an output value.


It will work same as a DOS example

If you type in DOS prompt
dir c:\ >c:\test.txt 
  • dir is the command (or EXE),
  • c:\ is the argument that is passed to the command
  • >c:\test.txt is the output redirection,
    • therefore the result is written in the specified file instead of to the screen.

From there write a batch file with Notepad containing the lines:
dir c:\ >c:\test.txt  
  • Save it in a folder accessible by PATH variable or c:\.
  • Your,exe normally displays the string of characters on the screen.

Thanks to amigo for this tip.

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled "Launch a .exe file from a .bat file," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).