Introduction
As I sit here, listening to nightcore (Go ahead and judge me!) reading threads on the Subreddit LetsNotMeet, I realize... I gotta make another post!
This time I have decided to show off one of my useful batch files, the VBScript SendKeys Command Generator.
The Software
Actually this one is pretty useless, unless you need it for the exact scenario that I made it for. However, it's quite genius anyway! What it does, is; It asks for the word or phrase you want written out, asks for a timeout period in seconds, and generates a text file with the necessary commands to write it out in a smooth style with a VB script.
I've only used this once, however, it makes the process of making VBScript write out text in a smooth way much faster, trust me on this one.
The Source Code
As always, the source code is right here, and I would appreciate it if you didn't take credit for the code I've written, and instead wrote something on your own. Using it yourself, I have nothing against, though.
Code
@echo off
setlocal EnableDelayedExpansion
set num=0
REM User input
echo Enter string:
set /p str=:
echo.
echo Enter timeout amount:
set /p tm=:
REM Check string length
echo %str%> tempfile.txt
for %%? in (tempfile.txt) do ( set /A strlength=%%~z? - 2 )
del tempfile.txt
REM Loop 1*string length
:b
for /L %%A in (1,1,%strlength%) do (
goto a
)
goto exit
:a
set res%num%="!str:~%num%,1!"
echo WshShell.SendKeys "!res%num%:~1,-1!">>Output.txt
echo WScript.Sleep %tm%>>Output.txt
set /a num+=1
set /a strlength-=1
goto b
:exit
exitUsing the File
To use it, simply just paste the source code into a text file and save it as a batch file (.bat).
QTDWBA (Questions That Definitely Will Be Asked)
Why would you ever make something this useless?
Well, I was working on a project quite a while ago, which required VBScript to write text in notepad by itself, and I wanted to make it look more "smooth" (And lazy as I am, I didn't want to write every line of code myself)
Why are you still here, Beigevenus? Haven't you given up on Batch yet?
I SHALL NEVER GIVE UP ON BATCH, AND YOU CAN'T STOP ME FROM MAKING MORE USELESS JUNK!!!

