sherwindu said:
It is not working. I'm not sure where to insert the command:
cscript //nologo c:\Windows\MyName.vbs
My shortcut looks like this:
Target: C:\windows\sherwin.vbs
Start In: C:\windows
Shortcut Key: Ctrl + Alt + Z
Run: Minimized
My script file looks like this in the c:\Windows directory:
Set ws=CreateObject("WScript.Shell")
ws.sendkeys("%{Tab}")
wscript.sleep(500)
ws.sendkeys("(e-mail address removed){Tab}pswd")
If I now go into my browser and point at the password box and double
click on the shortcut, it skips over this box, but puts the password into
the password box (some signs of life?). Also, I cannot invoke it to do
anything with the Ctrl + Alt + Z keys.
Sherwin
Let's look at the principles of what we're trying to do here.
I will start with the script file on a line by line basis.
* Set ws=CreateObject("WScript.Shell")
(This is a VB Script declaration. You must leave it as it is.)
* ws.sendkeys("%{Tab}")
(This instruction issues an Alt+Tab keystroke. It ensures
that the focus moves from the VB Script process to your
notepad or to your IE process.)
* wscript.sleep(500)
(This instuction causes the script to pause for half a second
so that the screen switching has time to settle down. If your
machine is slow then you should increase the delay to
maybe 2000.)
* ws.sendkeys("John Doe{Tab}MyPassword")
(This instruction sends your name, a tab and your password.
You could modify it like so:
ws.sendkeys("John Doe{Tab}MyPassword{Enter}")
You should now test the whole thing one step at a time.
Test 1
=====
- Click Start / Run / cmd {Enter}
- Type this command:
notepad c:\test.vbs{Enter}
Enter these four lines VERBATIM!
Set ws=CreateObject("WScript.Shell")
wscript.echo "Running Test #1"
wscript.sleep(500)
ws.sendkeys("John Doe{Tab}MyPassword")
Save and close the file.
- Type this command:
cscript //nologo c:\test.vbs{Enter}
- Report what you see.
After successfully completing this test, we can proceed to Test 2.