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