# $language = "VBScript" # $interface = "1.0" ' CloseTab.vbs Sub Main() szSession = crt.Dialog.Prompt("Enter session:", "", "", False) if szSession = "" then exit sub ' We'll connect to this session three times to create ' three separate tabs Set objTab1 = crt.Session.ConnectInTab("/S " & szSession) Set objTab2 = crt.Session.ConnectInTab("/S " & szSession) Set objTab3 = crt.Session.ConnectInTab("/S " & szSession) ' You cannot close the first tab in a SecureCRT window, ' but all other tabs can be closed... If MsgBox("Closing tab#2 after OK.", vbokcancel) <> vbok then exit sub objTab2.Close End Sub