Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 699

Input a password to dialog box after launching app through VB script

$
0
0
I have written a script that launches an application from my desktop. I have no knowledge in scripting, but was able to google around and have it done. However I am stuck at a point where I am not able to input the password in the dialog box that gets opened when I launch the app. Below is code :

Dim exeName
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")

exeName = """Actual Application path"""

call WshShell.Run (exeName, 1, true)
WScript.Sleep(100)
WshShell.AppActivate "TAE" '-- Please note that TAE is the name that appears on title bar of the app
WScript.Sleep(100)

'Passing the value password
WSHShell.SendKeys "welcome124"

'MOving to enter
WSHShell.SendKeys "{TAB}"

'Clicking enter to complete the screen
WSHShell.SendKeys "{ENTER}"
set WshShell=Nothing

Application gets launched and I get a dialog box which already has the username and cursor is on the password text field. Nothing happens after that. Sometimes password gets entered in some other application that is open - like notepad

Viewing all articles
Browse latest Browse all 699

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>