-2

I'm creating a script in a batch file. I want it to look someone is typing text when they open it.

Is there a easy way to do this? I didn't find anything in the last hour. Maybe I didn't search good

Thanks.

Tom
  • 119
  • 2
  • 2
  • 11
  • Take a look at `SET` command. the `/P` parameter is what you're looking for, I think. – Matt Williamson Oct 25 '13 at 12:07
  • waht do you mean - can you show an example? – yossico Oct 25 '13 at 12:12
  • Thanks for th reply. I mean something like the matrix. Just a typing effect. That you look at you screen nobody is pressing a button on your keyboard and you see new characters coming on your cmd/dos/bat screen. – Tom Oct 25 '13 at 12:39
  • I hope this explains it a little more. http://stackoverflow.com/questions/4339649/how-to-have-multiple-colors-in-a-batch-file#comments-link-5344911 The second code thing. When you past that in a batch file it looks like someone is typing on your screen some randon stuff. – Tom Oct 25 '13 at 12:41
  • Is there a easy way to do this ? – Tom Oct 25 '13 at 12:42
  • `echo Text` with echo the word Text to the screen. What, exactly, are you trying to do? – Matt Williamson Oct 25 '13 at 12:54
  • But that isn't what i'm looking for. I will search on ddg.gg to explain it better here. – Tom Oct 25 '13 at 13:04
  • Something like this : http://www.cgkmussel.nl/lichtkrant2.html But than in a .bat script. – Tom Oct 25 '13 at 13:04
  • Ahh. Here is a example of that: http://www.computerforum.com/134296-cmd-typing-effect.html – Matt Williamson Oct 25 '13 at 13:38
  • Thanks ! I will look. update: Ok, thats a way to do it. But why the ping ? – Tom Oct 25 '13 at 13:43
  • @user The ping acts as a delay in the script, giving it that "typing effect". – BDM Oct 25 '13 at 13:44
  • I found this and i will use it. Thanks
    @Echo off
    title Typewriter effect 
    echo H
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo He
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hel
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hell
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hello?
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hello? A
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hello? An
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hello? Any
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hello? Anyo
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hello? Anyon
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hello? Anyone
    ping 0.0.0.0 -n 2.5 > NUL
    cls
    echo Hello? Anyone?
    pause >nul
    
    – Tom Oct 25 '13 at 13:46
  • [How to Create the Matrix Rain in Command Prompt](http://www.wikihow.com/Create-the-Matrix-Rain-in-Command-Prompt) – Endoro Oct 25 '13 at 13:56

1 Answers1

0
@echo off
for %%i in (h e l l o) do (
   set /p a=%%i<nul
   ping 0.0.0.0 -n 2.5>nul 2>&1
)

try this

EDIT

this is what i use now

@ECHO OFF
call :talk %*
exit /b

:talk
if "%~1" EQU "" exit /b
set _=%~1
for /f "tokens=2 delims=# " %%i in ('prompt #$E#$H# ^& cmd /k ^<nul') do set BS=%%i
set speed=
if "%~2" EQU "" set speed=10000
if "%~2" EQU "/s" set speed=15000
if "%~2" EQU "/f" set speed=4000
if not defined speed (
      echo useage: %~n0 "text" ^(/f^|/s^)
      exit /b
)
:top
set /p=.%BS%%_:~0,1%<nul
for /l %%i in (1,1,%speed%) do call
set _=%_:~1%
if defined _ goto top
exit /b
cure
  • 2,588
  • 1
  • 17
  • 25