Solved Make a Batch file Type the response

September 21, 2013 at 09:01:32
Specs: Windows XP
OK, so I made a batch file that asks you questions and responds accordingly but I want it to look like its TYPING the questions and respond, not just having them POP out of nowhere instantaneously. And I know you can do
(wake) but is there an easier way

echo W
ping localhost -n .5 >nul
cls
echo Wa
ping localhost -n 1 >nul
cls
echo Wak
ping localhost -n 1 >nul
cls
echo Wake
ping localhost -n 1 >nul
cls


but is there an easier way?? Thanks


See More: Make a Batch file Type the response

Report •


#1
September 22, 2013 at 03:50:30
✔ Best Answer
Well, here you find my proposal to mimic human typing. Notice I coded the typing section using an internal subroutine to avoid cumbersome code. By the way this is advanced NT batch that has nothing to do with its ancestor DOS.

@echo off & setlocal EnableDelayedExpansion

cls
echo.
call :TYPE Wake
call :TYPE Hello World
call :TYPE Do you like to chat with me?
exit /B

:TYPE [subroutine to mimic human typing]
set string=%*
set response=& set cnt=0
:LOOP
if "!string:~%cnt%,1!"=="" (echo.& exit /B)
ping 1.0.0.0 -n 1 -w 400 > nul
set /P response=!response!!string:~%cnt%,1!< nul
set /A cnt+=1
goto :LOOP


Report •

#2
September 22, 2013 at 09:04:15
Nice setup IVO, Looks like legit typing. :)

::mike


Report •

Related Solutions


Ask Question