Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open a program and supply username and password

Status
Not open for further replies.

joeroc501

Technical User
Nov 8, 2002
1
US
I am new to vbscript and would like to know how to open a program and supply username and password. Any ideas?
 
can you run the program by entering the user name an password after it.

if you can then you could

Set wsh = Wscript.CreateObject("Wscript.Shell")
wsh.run "progam.exe fredbloggs password"

If not then you could load the program and then use sendkeys to send the username and password.

Dim wsh
set wsh = Wscript.CreateObject("Wscript.Shell")
wsh.run "Notepad"
Wscript.Sleep(2000)
wsh.AppActivate "Untitled - Notepad"
wsh.SendKeys "fredbloggs"
wsh.SendKeys "{TAB}"
wsh.SendKeys "password"

Regards
Steve Friday
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top