Gui*_*ark 2 text file batch-file
我想要实现的是我的批处理文件打开记事本并开始自动输入.到目前为止,这是我的代码:
@echo off
Start notepad
Run Code Online (Sandbox Code Playgroud)
但是我从哪里开始呢?我试过了:
@echo off
Start notepad
type "stuff"
exit
Run Code Online (Sandbox Code Playgroud)
和类似的东西,但它没有奏效.
有没有办法在Batch中执行此操作?
这是一个小玩具,我掀起来以准人类风格输入lineN变量中的文本到控制台屏幕.
请参阅代码以获取有关如何加速或减慢速度的提示.
@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
Run Code Online (Sandbox Code Playgroud)