Reputation: 573
With VBScript, is there a way to open an application and have it maximize its window when its default behavior is to minimize to the tray?
I have an app that opens to the tray and does not show its login screen. I am trying to automate the login process using VBScript and SendKeys
. I know this isn't secure since anyone can view the script but that isn't a concern.
Is there a way to open an app and then make it display its GUI? I also need to make sure that the app gets focus so that SendKeys
works.
I know how to open the app. The problem is getting the app to show its login screen.
Upvotes: 1
Views: 3263
Reputation: 19457
Dim oWsh : Set oWsh = CreateObject("WScript.Shell")
oWsh.Run("prog.exe", 1, False)
WScript.Sleep 500
oWsh.AppActivate "Prog Title" ' text in window title of 'prog.exe'
oWsh.SendKeys "first Command"
' ...additional SendKeys commands
References: Run Method and SendKeys Method
Upvotes: 1