I made a vbs script to launch a program and to put in the login credentials. When i run the script by clicking it works perfect, but when launched trough the scheduler it does not work as desired. The script is as follows:
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Exec("C:\blp\Wintrv\WINTRV.EXE")
Set objShell = Nothing
WScript.Sleep 5000
set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 1000
WshShell.AppActivate "1-BLOOMBERG"
WScript.Sleep 1000
WshShell.SendKeys "{ESCAPE}"
WScript.Sleep 1000
WshShell.SendKeys "login~"
WScript.Sleep 1000
WshShell.SendKeys "username " 'do not remove spaces after username
WScript.Sleep 1000
WshShell.SendKeys "password~"
When launched via the scheduler i see that Bloomberg opens in the task bar, but the window is never activated nor the credentials are put in. Any idea's why it does not work?