Within [this] thread, several options have been shown sending a single key/multiple keys to your PC using TCMD
I've written a tiny [AutoHotkey] script that can be executed using a TCMD command (line), where its parameters are representing the keys that should be sent to the PC.
Additionally, it allows specifying a delay (sec) after a key has been "pressed"/sent.
So, the following TMCD command line...
autohotkey.exe script.ahk {F2}:1.5 {F3}:5 {F4}:3 "Hello World" {F5}
https://www.autohotkey.com/docs/Scripts.htm#cmd
...will execute 'script.ahk' on the PC that will process the space-separated parameters like '{F2}:1.5' ... into keypresses ...in its consecutive order.
script.ahk
#SingleInstance, Force
Loop % A_Args.Count()
{ param := StrSplit(A_Args[A_Index],":")
p := InStr(A_Args[A_Index],":") ? param.1 : A_Args[A_Index]
d := InStr(A_Args[A_Index],":") ? param.2 : 1
Send % p
Sleep % d*1000
}
In my test case, this would trigger the following hotkeys, set up in an already running script on my PC (myHotkeys.ahk), that are persistently waiting to be triggered via the key presses executed via TCMD.
myHotkeys.ahk
F2::MsgBox % A_Now
F3::SoundBeep
F4::Run % "notepad.exe"
F5::FileAppend,% A_Now, my.log
What means...
...once {F2} has been sent, a message box will be opened showing a timestamp : sleeping for 1.5 sec
...once {F3} has been sent, a soundbeep occurs : sleeping for 5 sec
... once {F4} has been sent, notepad opens : sleeping for 3 sec
The string 'Hello World' is sent to the app that has the focus : default delay of 1 sec (bc it wasn't explicitly set)
... finally {F5} has been sent, timestamp will be written to 'my.log' ... *
As you can see, besides triggering AHK Hotkeys you can send generic text strings too (and/or call functions() etc.)
BTw, ATM - no specific error handling!
If, for whatever reason you think it's necessary to "compile" an AutoHotkey script you can do that as well. Help yourself:
https://www.autohotkey.com/docs/Scripts.htm#ahk2exe
Disclaimer: you're using the script(s) at your own risk.
* you've to set up TC accordingly to be able to handle 'background'-commands/parameters!