View Single Post
Old 02-21-2019, 08:39 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
Join Date: Jan 2017
Posts: 654
Hi Nico,

The issue you're experiencing is not specific to SecureCRT, this is an issue with VBScript and the Internet Explorer object. Removing all SecureCRT specific code, crt.Sleep and crt.Screen.SendKeys, would likely result in the same behavior. You can test this by replacing crt.Sleep with WScript.Sleep and running the script outside of SecureCRT.

I've included a modified version of your script below, simply save it to your desktop and double click it to run.

' Get a reference to IE's Application object
Set g_objIE = CreateObject("InternetExplorer.Application")
'g_objIE.Offline = True
g_objIE.Offline = False
g_objIE.navigate ""
' This loop is required to allow the IE object to finish loading...
WScript.Sleep 100
Loop While g_objIE.Busy

' Prevent the MenuBar, StatusBar, AddressBar, and Toolbar from
' being displayed as part of the IE window
g_objIE.MenuBar = False
g_objIE.StatusBar = False
g_objIE.AddressBar = False
g_objIE.Toolbar = False
' Set the initial size of the IE window
g_objIE.height = 400
g_objIE.width = 425
' Set the title of the IE window
g_objIE.document.Title = "SFK"

g_objIE.Visible = True
' This loop is required to allow the IE window to fully display
' before moving on
WScript.Sleep 100
Loop While g_objIE.Busy

' This code brings the IE window to the foreground (otherwise, the window
' would appear, but it would likely be behind the SecureCRT window, not
' easily visible to the user).
Set objShell = CreateObject("WScript.Shell") 
objShell.AppActivate g_objIE.document.Title
' Once the dialog is displayed and has been brought to the
' foreground, set focus on the control of our choice...
Because this is not specific to SecureCRT, this is generally outside the scope of support we can provide. I would suggest seeking further assistance from a VBScript specific source.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote