用vbs sendkeys
假设你已打开超级终端并命名为aa,将下面的代码另存为st.vbs,双击运行即可。
Dim WshShell
Set WshShell=WScript.CreateObject("WScript.Shell")
WScript.Sleep 200
WshShell.AppActivate "aa - 超级终端"
WScript.Sleep 200
WshShell.SendKeys "{ENTER}“
WScript.Sleep 200
WshShell.SendKeys "EN“
WScript.Sleep 200
WshShell.SendKeys "cisco“
WScript.Sleep 200
WshShell.SendKeys "show{BS}config“
如果一定要批处理的话就吧下面的代码存为st.bat
echo Dim WshShell>st.vbs
echo Set WshShell=WScript.CreateObject("WScript.Shell")>>st.vbs
echo WScript.Sleep 200>>st.vbs
。
。
。
echo WshShell.SendKeys "show{BS}config“>>st.vbs
st
del st.vbs