Link to home
Create AccountLog in
Avatar of etech0
etech0Flag for United States of America

asked on

Website shortcut followed by sendkeys

Is there a way to edit a web shortcut so that immediately after opening it "types" certain keys? (sendkeys, perhaps?)
Thanks!
Avatar of jrwarren
jrwarren
Flag of United States of America image

Are you looking for an effect on the screen or such as to fill out a form auto-generation style?
Avatar of etech0

ASKER

yes - to input my password to the site, and then to save that web page on my desktop.
Create a VB Script to access On-Line accounts with Internet Explorer that require  Logon ID and Passwords.
Save the Scripts to a Folder and then create a Shortcut to the Scripts.
The Shortcut is then placed in C:\Documents and Settings\UserName\Favorites\Links for XP and for Vista/W7 C:\Users\UserName\Favorites\Links.

Note: The Favorites folder that you are navigating to is displayed as Favorites Bar. The Favorites Menu will have to be enabled in Internet Explorer to be able to access the links.

When you get to the site that requires the information place the cursor in the first field which is normally the Logon ID and left click on the appropriate link. User information is copied over and you will have access to the site. Log off when you are finished using the site.

Copy and edit the text below and give it a recogniseable name with a .vbs extension. The Names can be edited on the Favorites Bar Menu by right clicking and select Rename.

Anything that comes after the ' is a comment.


set WshShell = WScript.CreateObject("WScript.Shell")
        WScript.Sleep 600  ' timer
        WshShell.SendKeys "Logon ID in here" ' EG: "tex@texas.com"
      WScript.Sleep 600
      WshShell.SendKeys ("{TAB}") ' move to next field
      WScript.Sleep 600
        WshShell.SendKeys "Password in here" ' EG: "password"
      WScript.Sleep 600
      WshShell.SendKeys "~" ' and press the enter key for me


This all came about because I didn't want to use Auto Complete.
Stored passwords become easy targets for viruses because they know exactly where the auto complete programs store them.
As I have seven different sites with different access accounts I wanted an easy way to access the accounts without having to type in all of that information each time I visit a site or I might have someone standing behind me as I'm entering my password.
Each browser has an Autofill/Autocomplete feature.

FireFox has Autofill

Google has Autofill

Internet Explorer has AutoComplete with vWallet

Would these be something similar to what you are requesting?
Avatar of etech0

ASKER

@rrjmin0
I am going to look at this in depth.
Just a quick question - can I have the vbscript run/open my shortcut to the webpage? That would tidy things up a bit.
That would be nice, I suppose that you could open a page and try to find out where the cursor is and then count the tabs required and then modify the script by adding each tab before sending sendkeys
Avatar of etech0

ASKER

Yes, that's what I'm working on.
Do you know how I can have the vbscript run/open my shortcut to the webpage?
Avatar of etech0

ASKER

Also, how long does WScript.Sleep 600 wait?
It works in milliseconds,  so WScript.Sleep 600 waits for 600 milliseconds

It would probably be easier to make a shortcut to your script and open the web page EG:
 Run Internet Explorer and open Experts Exchange

set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 100
wshshell.run "iexplore.exe https://www.experts-exchange.com",1



You could also use AutoHotKey for this. It work wonders - especially for tasks like this - opening a webpage and entering in username/password.
PS if you would like a sample of code to perform the above - please let me know!
Avatar of etech0

ASKER

"wshshell.run "iexplore.exe https://www.experts-exchange.com""
Can I run the above code but using firefox?
Yes, you can use firefox to open a web page with this code.
just change iexplore.exe to the firefox executable name - and then it should run.
ASKER CERTIFIED SOLUTION
Avatar of Rob Miners
Rob Miners
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of etech0

ASKER

That did the trick!
Thanks for all your help.
No probs and your welcome