0

Hi I start use autohotkey, I have a simple script to run cmd and execute some command, like this:

echo ^Q>COM5

Autohotkey script:

run cmd.exe
WinWait, ahk_exe cmd.exe ;
Send ECHO ^{Q}>COM{Numpad5}{enter}

But right angle bracket gets displayed as dot.

I also tried instead of >, (asc 0062) or !{.}

Where do I make a mistake?

2 Answers 2

0

You can use a Send {Raw} to send literal strings. You would need to put the {Numpad5}{enter} in a separate send statement that is not a send {raw}, but you can split the text you need to send into as many send statements as needed.

You can also launch the command directly using a run statement--that may or may not be of interest to you, but saves having to send keyboard input to the command window.

0

You send upper case Q which also implies the Shift key being sent. Sending to the console can be a bit tricky, the developer of AutoHotkey has made a separate function which may help, ConsoleSend() by Lexikos here https://autohotkey.com/board/topic/25446-consolesend/

You can send the text using ConsoleSend() and then a regular Send for the numpad+enter keys

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .