Re: Hot key needed





"Pegasus (MVP)" wrote:

"sherwindu" <sherwindu@xxxxxxxxxxx> wrote in message
news:473E3F57.BB168F8E@xxxxxxxxxxxxxx



Get onto Google and type in these words:

Create a shortcut in Windows

Step 6 is purely for testing your handiwork.

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("sherwindu@xxxxxxxxxxx{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.

OK. I see the following in the DOS Window after typing the cscript command:

Running Test #1
C:\Documents and Settings\sherwin dubren>John Doe MyPassword

This much appears to be working. As I stated previously, I saw the same thing
when I double clicked on the shortcut I created. My problem remains how to
invoke the cscript command with the hot keys. I modified the shortcut to use
the hot keys, but that didn't work.

Sherwin




.



Relevant Pages

  • Re: How can I bind a Network Connection to a key on the keyboard?
    ... Vendors can write their own user interface to program the registry keys or use INF files to install special entries as defaults. ... >> command brings up the connection's status? ... >> I used tweakui to assign a dialup shortcut to the mail button. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Hot key needed
    ... Create a shortcut in Windows ... I'm not sure where to insert the command: ... I will start with the script file on a line by line basis. ... cscript //nologo c:\test.vbs ...
    (microsoft.public.win2000.general)
  • Re: help writting script to copy file to every desktop
    ... Then it will ping each computer to see if it is truly reachable. ... Here is a sample script that I use. ... Each shortcut is only 1KB each, so the extra replication traffic is nothing. ... You will get different methods, collections, and properties for a file than you will for a folder. ...
    (microsoft.public.scripting.vbscript)
  • Re: Findout shortcut from which script was launched ?
    ... apply the script to selected files. ... &Cmd window in this directory ... Context Cmd window.lnk shortcut has the following properties set: ... and when selecting a file or several, selecting Send To the script in the ...
    (microsoft.public.scripting.vbscript)
  • Re: batch file shortcut
    ... I found a script for creating shortcuts, ... another command to move the shortcut from the present directory to the ... Now though this script creates the shortcut properly, ... batch file command or a set of commands for creating a shortcut will ...
    (microsoft.public.scripting.vbscript)