Você poderia fazer isso usando o VBScript. Eu sei que há um comando SendKeys
que pode enviar praticamente qualquer tipo de entrada de teclado para um programa lançado através do script.
Aqui está uma maneira de usá-lo :
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run "runas /user:domain\user %comspec%" 'Open command prompt
WScript.Sleep 1000
WshShell.SendKeys "password" 'send password
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
'Open IE
WshShell.SendKeys Chr(34) + "C:\PROGRAM FILES\INTERNET EXPLORER\IEXPLORE.EXE"_
+ Chr(34)
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "exit" 'Close command prompt
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "http://www.microsoft.com" 'Send internet page to open to IE
WshShell.SendKeys "{ENTER}"
Aqui está outro método de usá-lo sem WshShell
:
Dim ProcID As Integer
' Start the Calculator application, and store the process id.
ProcID = Shell("CALC.EXE", AppWinStyle.NormalFocus)
' Activate the Calculator application.
AppActivate(ProcID)
' Send the keystrokes to the Calculator application.
My.Computer.Keyboard.SendKeys("22", True)
My.Computer.Keyboard.SendKeys("*", True)
My.Computer.Keyboard.SendKeys("44", True)
My.Computer.Keyboard.SendKeys("=", True)
' The result is 22 * 44 = 968.