SecureCRT中脚本进行交互,发送Ctrl+C
Dim g_fso
Set WshShell = CreateObject("WScript.Shell")
Dim objSession
Dim objTab
Set objTab = crt.GetActiveTab
Set objSession = objTab.Session
Set objScreen = objTab.Screen
Dim strRestartString
strRestartString = crt.Arguments.GetArg(0)
Dim strIP4Test
strIP4Test = crt.Arguments.GetArg(1)
objScreen.Send strRestartString & vbcr
objTab.Screen.WaitForString "/mnt/nfs_em1/spu2>"
Do
objScreen.Send "ping " & strIP4Test & vbcr
If(objScreen.WaitForString("ms", 1)) Then
objScreen.SendKeys "^C"
Exit Do
end if
Loop