Solved automatically input answer to batch file

June 7, 2015 at 17:14:26
Specs: Windows 7
I have a batch file that I run on 10 different networks. It asks me what site I am testing and I have to enter the numbers and press enter for each store.

I can't edit the existing batch file so I want to create another batch file that calls that batch file and provides the answer.

For example, The batch file I am running is called sweep.bat. When I run it, the batch file asks "What site are you testing? I have to type 3003 and press enter.

I want to create a batch file that calls sweep.bat and provides 3003 and press enter. This way, all I have to do to run it is to press enter on the batch file I created to run sweep.bat.

Thank you for your time

See More: automatically input answer to batch file

Report •

June 7, 2015 at 21:05:03
✔ Best Answer
@echo off & setlocal
for /f "tokens=*" %%a in (jes) do (
echo %%a|sweep.bat
::--- end batch
::text-file "jes" is a simple list of CRLF delimited numbers to be submitted to "sweep". Up to you to fix the paths etc. Those are local issues.

Report •
Related Solutions

Ask Question