这是一个单行解决方案:此行将键入" Testing 123 ",然后按Enter键.
echo >script.vbs set shell = CreateObject("WScript.Shell"):shell.SendKeys "Testing 123{ENTER}" & script.vbs
Run Code Online (Sandbox Code Playgroud)
你可以使用vbscript.例如,此脚本将使扬声器静音.
set shell = CreateObject("WScript.Shell")
shell.run"Sndvol"
WScript.Sleep 1500
shell.SendKeys"{TAB}"
shell.SendKeys" "
shell.SendKeys"%{F4}"
Run Code Online (Sandbox Code Playgroud)
你用控制台从控制台启动它
cscript mute.vbs
Run Code Online (Sandbox Code Playgroud)
这里有更多的信息