Sendkeys from command prompt

Eugene picture Eugene · Mar 14, 2012 · Viewed 36.2k times · Source

Is there a way to use sendkeys (or something equivalent) from (not to) the command prompt?

Answer

Michael Haephrati picture Michael Haephrati · Jun 14, 2015

Here is a one line solution: This line will type "Testing 123" and then hit Enter.

echo >script.vbs set shell = CreateObject("WScript.Shell"):shell.SendKeys "Testing 123{ENTER}" & script.vbs