Re: Hot key needed
"sherwindu" <sherwindu@comcast.net> wrote in message
news:473F2EE2.81795029@comcast.net...
>
>
> "Pegasus (MVP)" wrote:
>
>> "sherwindu" <sherwindu@comcast.net> wrote in message
>> news:473F1BA5.D77E1C6@comcast.net...
>> >
>> >
>> > "Pegasus (MVP)" wrote:
>> >
>> >> "sherwindu" <sherwindu@comcast.net> wrote in message
>> >> news:473E3F57.BB168F8E@comcast.net...
>> >> >
>> >> >
>> >> >
>> >> >> 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@comcast.net{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
>>
>> Seeing the confusion we had before, I'm not going to skip any
>> steps, even though they may be unnecessary.
>>
>> Test 2
>> =====
>> - Click Start / Run / notepad.exe c:\test.vbs {OK}
>> - Enter these five lines VERBATIM!
>>
>> Set ws=CreateObject("WScript.Shell")
>> wscript.echo "Running Test #2"
>> ws.sendkeys("%{Tab}")
>> wscript.sleep(1000)
>> ws.sendkeys("John Doe{Tab}MyPassword")
>>
>> - Save and close the file.
>> - Create a new shortcut on your desktop. Type this line into
>> the "Target" field:
>
> It is not labled "Target" field, but is called the "location" of
> the item. I put the string into there.
>
>>
>> cscript.exe //nologo c:\test.vbs
>> - Copy the new shortcut into the Quick-Launch bar.
>> - Click Start / Run notpad.exe {OK}
>
> This just opens up an untitled notepad window.
>
>>
>> - Click the new shortcut in the Quick-Launchh bar.
>> - Report what you see
>
> A DOS window appears briefly, and that's all.
>
>
I agree with your first point: The shortcut field is called
"Location of the item" when you create it and "Target"
when you subsequently inspect the properties of the
shortcut.
Why your logon name does not appear in the notepad
field I do not know. I can think of two reasons:
- The key combination Alt+Tab is disabled on your machine, or
- You omitted or mistyped the line of code that generates
his keystroke. It should be: ws.sendkeys("%{Tab}")
It is best to copy and paste this line rather than retyping
it, to avoid mistakes.
Since I cannot see what you did, I am unable to assist you
further. I can see three options for you, listed in order of preference:
- You drop the idea.
- You become familiar with AutoIT (
http://groups.yahoo.com/group/autoit)
or with Keyboard Express (
http://www.keyboardexpress.com/ )
as suggested by Sid Elbow.
- You let me have a look at your machine by remote access.
If you're interested in finding out more about the third option,
drop me a line (pegasus_fnlATyahooDOTcom) within 24 hours.
Target" under
WinXP and