Set objShell = WScript.CreateObject("WScript.Shell") Set filesys = CreateObject("Scripting.FileSystemObject") Set objNetwork = WScript.CreateObject("WScript.Network") MyUser = objNetwork.UserName if MyUser = "hsepulveda" then objShell.run "IEXPLORE.EXE kdscsp07/citrix/metaframexp/default/login.asp?ClientDetection=On" ' page to go -> /http://kdscsp07/citrix/metaframexp/default/login.asp?ClientDetection=On" ' Wait until page is fully loaded Do until objshell.AppActivate ("MetaFrame XP Login - Microsoft Internet Explorer") WScript.Sleep 500 Loop If filesys.FileExists("c:\autom.nfo") Then '' --> Open file, Read UserName & Password Set ts = filesys.OpenTextFile("c:\autom.nfo", 1) UN = ts.ReadLine PS = ts.ReadLine Typing() Else '' --> Read UserName & Password, Create file UN = InputBox(" Enter your UserName ...") If UN <> "" then PS = InputBox(" Enter your Password ...") IF PS <> "" then Set filetxt = filesys.CreateTextFile("c:\autom.nfo", True) filetxt.WriteLine(UN) filetxt.WriteLine(PS) filetxt.Close Typing() End If End IF End If Else If filesys.FileExists("c:\autom.nfo") Then Set f3 = filesys.GetFile("c:\autom.nfo") ' Delete the files. f3.Delete end if end if wscript.sleep 2000 objShell.run "IEXPLORE.EXE http://sops/" , 7 wscript.sleep 2000 objShell.run "OUTLOOK.EXE" , 7 '//Common Procedure to type all info Sub Typing() wscript.sleep 2000 objShell.sendkeys UN objShell.sendkeys "{TAB}" objShell.sendkeys PS objShell.sendkeys "{TAB}" objShell.sendkeys "{down}" objShell.sendkeys "{TAB}" objShell.sendkeys "{ENTER}" wscript.sleep 4500 Tabs(8) wscript.sleep 4500 Tabs(11) wscript.sleep 8000 objShell.sendkeys "%{TAB}" Tabs(12) End Sub '// function to hit tab x times + enter Function Tabs(ByVal x) for i = 1 to x objShell.sendkeys "{TAB}" next objShell.sendkeys "{ENTER}" End Function