.txt 文件中的多行 vbs 自动打字机

Multi line vbs auto typer from .txt file

所以我一直在开发一个巨魔终端,现在我想输入整个蜜蜂电影脚本或我放入文本文件中的任何内容。 我需要帮助的是获取文本(带有输入和空格)并完全输入。 另一种说法是我想获取一个文本文件并将其复制然后输入。 我找不到任何合适的代码来执行此操作,这就是我在这里问的原因。

另外,如果可能的话,让它输入您在文本文件中输入的任何内容。 (I have no clue why it doesnt let me post this)

想法:我可能知道另一种方法,但我不知道如何完成它。 Maby 有一种方法可以无限地为每一行生成变量并像这样输入它们。

其他想法:我也许可以制作一个工具让我快速对其进行硬编码。

    Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile("C:\yourfirstfile", 1)
content = file.ReadAll

Const fsoForAppend = 8

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Open the text file
Dim objTextStream
Set objTextStream = objFSO.OpenTextFile("C:\yoursecondfile", fsoForAppend)

'Display the contents of the text file
objTextStream.WriteLine content 


'Close the file and clean up
objTextStream.Close
Set objTextStream = Nothing
Set objFSO = Nothing

Set wshShell = CreateObject("Wscript.Shell")
wshShell.run "C:\yoursecondfile"

告诉我它是否有效

是的,我自己回答。

这个脚本有效,但它双击输入,如果我想出如何阻止这种情况发生,我会更新它。

Set wsh=WScript.CreateObject("WScript.Shell")
sub custom_text_typer_confirm
Set objFileToRead =WScript.CreateObject("Scripting.FileSystemObject").OpenTextFile("Custom_Text_Typer.txt",1)
strFileText = objFileToRead.ReadAll()
objFileToRead.Close
custom_typer_wait = inputbox("How long should the program wait untill it will start typing?", "Eclips-Terminal Custom Text Typer")
custom_typer_wait1=custom_typer_wait * 1000
Wscript.sleep custom_typer_wait1
wsh.sendkeys (strFileText & "{enter}")
Wscript.sleep 1000
call home
end sub