Re: Hot key needed




"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.


.



Relevant Pages

  • Re: Command line input to CScript/WScript?
    ... > command to my script. ... > Now there's a way to do this which involves having CSCript ... I wish to do this without having a .vbs file on disc. ...
    (microsoft.public.scripting.vbscript)
  • Re: Writing to the Environment ?
    ... > executed by CSCRIPT at a command prompt in a MS-DOS box, ... > the values of extant environment variables. ... > Is it possible to write such a script that will change the extant ... > following the CSCRIPT - and, if so, how? ...
    (microsoft.public.scripting.wsh)
  • 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. ... invoke the cscript command with the hot keys. ...
    (microsoft.public.win2000.general)
  • Command line input to CScript/WScript?
    ... Is there a way that I can give CScript and WScript a command ... command to my script. ... Now there's a way to do this which involves having CSCript ... I wish to do this without having a .vbs file on disc. ...
    (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)

Loading