一次键入一行文本文件

时间:2014-07-25 08:40:07

标签: batch-file

我正在编写一个批处理脚本,可以从驱动器上的各种文件中获取数据,并且该位工作正常。 问题是我希望一次只能在cmd中输入文件的内容。

有点像这样:

Hello, this is the first line of the text file

暂停1秒

And this is the second line

我尝试过使用for命令,但我只能重复第一行。

任何帮助将不胜感激,谢谢先进!路加福音

2 个答案:

答案 0 :(得分:0)

在这篇文章中,你可以找到很多方法来根据你的需要延迟脚本的执行:

Sleeping in a batch file

希望它有所帮助。

答案 1 :(得分:0)

timeout在Vista及以上

@echo off
for /f "usebackq delims=" %%a in ("file.txt") do (
echo %%a
timeout /t 1 /nobreak
)
pause
相关问题