Echo Message to Command Prompt using AutoIT?

2019-07-03 08:21发布

问题:

How do I echo the contents of a variable, to the command prompt, using AutoIT? All I want to do is display a message in the command prompt.

Run("C:\WINDOWS\system32\cmd.exe")
WinWaitActive("C:\WINDOWS\system32\cmd.exe")
$message = 'Type: "edit file_name.ext" to create or edit a file'
send("$message {ENTER}")

回答1:

You need to put the variable before the quote, then it gets evaluated:

send($message & "{ENTER}")