怎样使一个文本文件出现类型本身使用批处理文件? [英] How do I make a text file appear to type itself using a batch file?

查看:128
本文介绍了怎样使一个文本文件出现类型本身使用批处理文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图让一个文本文件[记事本]打开并启动自动输入,到目前为止,我有:
关闭@echo
记事本启动

So I'm trying to make a text document [notepad] open and start typing automatically, so far I have: @echo off Start notepad

但我在哪里何去何从?我试过了:
关闭@echo
启动记事本
键入东西
退出

but where do I go from here? I tried: @echo off Start notepad type "stuff" exit

但它没有工作。 [是的,我尝试过其他的东西]
如果有人知道该怎么做比请大家帮帮忙,谢谢。

but it didn't work. [yes, I tried other stuff to] If anyone knows what to do than please help out, thanks.

推荐答案

下面是一个小玩具我刮起了输入了这是在亚麻变量,在准人的风格,控制台屏幕上的文字。

Here's a little toy I whipped up to type out the text that's in the lineN variables, in a quasi-human style, to the console screen.

查看code就如何加快步伐还是慢下来小费。

See the code for a tip on how to speed it up or slow it down.

@echo off
:: Ghost typer
setlocal enableextensions enabledelayedexpansion

set lines=6


set "line1=Twinkle twinkle little star"
set "line2=How I wonder what you are"
set "line3=Up above the world so high"
set "line4=Like a diamond in the sky"
set "line5=Twinkle twinkle little star"
set "line6=How I wonder what you are"


for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"

for /L %%a in (1,1,%lines%) do set num=0&set "line=!line%%a!"&call :type

pause>nul
goto :EOF

:type
set "letter=!line:~%num%,1!"
set "delay=%random%%random%%random%%random%%random%%random%%random%"
set "delay=%delay:~-6%"
if not "%letter%"=="" set /p "=a%bs%%letter%" <nul

:: adjust the 3 in the line below: higher is faster typing speed

for /L %%b in (1,3,%delay%) do rem
if "%letter%"=="" echo.&goto :EOF
set /a num+=1
goto :type

这篇关于怎样使一个文本文件出现类型本身使用批处理文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆