1

I am writing a batch script that can fetch data from various files on a drive, and that bit is all working fine. The problem is that I would like the contents of the file to be typed to the cmd one line at a time.

A bit like this:

Hello, this is the first line of the text file

1 second pause

And this is the second line

etc.

I've tried using a for command, but I could only get that to repeat the first line.

Any help would be greatly appreciated, thanks in advanced! -Luke

MrYodaylay
  • 21
  • 6

2 Answers2

0

You can find many ways how to delay execution of script depending on your needs in this post:

Sleeping in a batch file

Hope it helps.

Community
  • 1
  • 1
Jan Kukacka
  • 988
  • 10
  • 27
0

timeout is in Vista and above

@echo off
for /f "usebackq delims=" %%a in ("file.txt") do (
echo %%a
timeout /t 1 /nobreak
)
pause
foxidrive
  • 37,659
  • 8
  • 47
  • 67