Quantcast

Maximum PC

It is currently Sat Aug 02, 2014 1:19 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: vbs to pass a password to windows Security popup? - Solved!
PostPosted: Thu Nov 11, 2004 9:09 am 
Little Foot
Little Foot

Joined: Sun Aug 29, 2004 6:55 am
Posts: 169
For anyone whos familiar with Outlook Web Access, you know that to log in, your prompted with the standard windows authentication box to enter your username and password.

ie:
Image

Well, for some reason, the Save Password option doesnt actually save the password... the only thing it does is save the username.

So I want to make a vbs file that launches the link to the website, perhaps pauses for a few seconds so the login box has time to come up and pass in a pre-defined password... and if possible, but not required, even press <enter> so that the OK button is executed and it automatically logs in...

Ive taken care of the easy part of creating the batch file that launches the link, so all I need is the last portion mentioned above...
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run("iexplore.exe <web address here>")


To perhaps make things easier, whenever the link is hit the password field is automatically selected.. so really I simply need to be able to pass a string into the active field.

Any suggestions?

Thanks!


Top
  Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 10:24 am 
Little Foot
Little Foot

Joined: Sun Aug 29, 2004 6:55 am
Posts: 169
ah yes... google is your friend...
http://www.winguides.com/scripting/refe ... category=3

Pieces here and pieces there and I got it working if anyone cares...

Code:
'VBScript Example
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "iexplore.exe <website address>"

'Wait 2 seconds for page to load
WScript.Sleep 2000

'Ensure the "active" (focus) window is the IE window
'This needs to include something specific to the title bar of the parent IE window,
'NOT the title bar of the password window.
WshShell.AppActivate "<portion of parent title window>"

'Pass the password
WshShell.SendKeys "<password>"

'Press Enter
WshShell.SendKeys "{ENTER}"


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group