set WshShell = WScript.CreateObject ("WScript.Shell") 'WshShell.run "IEXPLORE.EXE kdscsp07/citrix/metaframexp/default/login.asp?ClientDetection=On" c = 0 Do until WshShell.AppActivate ("Chat Window - Microsoft Internet Explorer") WScript.Sleep 500 c = c + 1 Loop WScript.Sleep 500 msgbox "Hello World " & c