Hotkey detective

  • Thread starter Thread starter Stan Brown
  • Start date Start date
S

Stan Brown

PC Magazine used to distribute a ?Hotkey Detective? program,
which would look through all the Start Menu and find the
key combinations, then present them in an easyview list.

Unfortunately that program can?t read the Win XP Start Menu
structure, and PC Mag is charging for the XP-compatible
version.

Does anyone know of a good way to list all the user-defined
hotkey shortcuts in the Start Menu? (I?m not asking about
the accelerator keys, the ones that show up underlined in
menus, but about the ones users can define in the Properties
dialog for shortcuts.)
 
Create a text file and paste lines in

on error resume next
set WshShell = WScript.CreateObject("WScript.Shell")
Set Ag=Wscript.Arguments
set lnk = WshShell.CreateShortcut(A)
If lnk.hotkey <> "" then
msgbox A & vbcrlf & lnk.hotkey
End If

Rename it to findhotkey.vbs

Explorer looks in 4 places for hotkeys, these are read on startup. The hotkey is stored in the shortcut. Only hotkeys on shortcuts in the four locations are live.

Type in a command prompt

cd %UserProfile%\desktop
for /r %A in (*.lnk) do findhotkey.vbs "%1"
for /r %A in (*.pif) do findhotkey.vbs "%1"
for /r %A in (*.url) do findhotkey.vbs "%1"
cd %AllUsersProfile%\desktop
for /r %A in (*.lnk) do findhotkey.vbs "%1"
for /r %A in (*.pif) do findhotkey.vbs "%1"
for /r %A in (*.url) do findhotkey.vbs "%1"
cd %UserProfile%\Start Menu
for /r %A in (*.lnk) do findhotkey.vbs "%1"
for /r %A in (*.pif) do findhotkey.vbs "%1"
for /r %A in (*.url) do findhotkey.vbs "%1"
cd %AllUsersProfile%\Start Menu
for /r %A in (*.lnk) do findhotkey.vbs "%1"
for /r %A in (*.pif) do findhotkey.vbs "%1"
for /r %A in (*.url) do findhotkey.vbs "%1"

Each shortcut, that has a hotkey, will pop up a dialog with the name of the shortcut and it's hotkey.

You may have path problems. To make it work put in c:\ and change

for %A in (*.url) do c:\findhotkey.vbs "%1"

as all these directory changes may make it difficult for the script to be found (but shorten the amount of typing for the start menu FORs).

Ctrl + C Copies the text of a message box to the clipboard.

Your comments about Hotkey detective shows that it was incorrectly programmed. If it was correctly written it wouldn't care that paths are different.
 
Create a text file [findhotkey.vbs] and paste lines in

on error resume next
set WshShell = WScript.CreateObject("WScript.Shell")
Set Ag=Wscript.Arguments
set lnk = WshShell.CreateShortcut(A)
If lnk.hotkey <> "" then
msgbox A & vbcrlf & lnk.hotkey
End If

First, thanks for taking the trouble to answer.

I haven't learned scripting yet, but are you sure about the
above? That "CreateShortcut( )" seems like an odd name for a
function to interrogate a shortcut.

Also, "Set Ag=" or "set A="?
Explorer looks in 4 places for hotkeys, these are read on startup. The hotkey is stored in the shortcut. Only hotkeys on shortcuts in the four locations are live.

Type in a command prompt

cd %UserProfile%\desktop
for /r %A in (*.lnk) do findhotkey.vbs "%1"

Should the argument be %A not %1?

[snip]
cd %AllUsersProfile%\Start Menu
for /r %A in (*.lnk) do findhotkey.vbs "%1"

There was quite a long pause after this line, which makes
sense as I've moved virtually all my menu items to the
All Users menu. But no message boxes popped up. I retried
with %A for %1, also with Set A= for Set Ag=, but no
difference.
 
Stan,

I have used these scripts and they work (well, my versions below do).

Yes, the parameter should be %A

This is my version of the batch file:
(There are %% because this is a batch file. I named it findhotkeys.bat and
put it and findhotkey.vbs in the folder C:\Batch Files. I executed it by a
shortcut with target "C:\Batch Files\find hotkeys.bat")

cd %UserProfile%\desktop
for /r %%A in (*.lnk) do "C:\Batch Files\findhotkey.vbs" "%%A"
for /r %%A in (*.pif) do "C:\Batch Files\findhotkey.vbs" "%%A"
for /r %%A in (*.url) do "C:\Batch Files\findhotkey.vbs" "%%A"
REM
cd %AllUsersProfile%\desktop
for /r %%A in (*.lnk) do "C:\Batch Files\findhotkey.vbs" "%%A"
for /r %%A in (*.pif) do "C:\Batch Files\findhotkey.vbs" "%%A"
for /r %%A in (*.url) do "C:\Batch Files\findhotkey.vbs" "%%A"
REM
cd %UserProfile%\Start Menu
for /r %%A in (*.lnk) do "C:\Batch Files\findhotkey.vbs" "%%A"
for /r %%A in (*.pif) do "C:\Batch Files\findhotkey.vbs" "%%A"
for /r %%A in (*.url) do "C:\Batch Files\findhotkey.vbs" "%%A"
REM
cd %AllUsersProfile%\Start Menu
for /r %%A in (*.lnk) do "C:\Batch Files\findhotkey.vbs" "%%A"
for /r %%A in (*.pif) do "C:\Batch Files\findhotkey.vbs" "%%A"
for /r %%A in (*.url) do "C:\Batch Files\findhotkey.vbs" "%%A"
REM
pause

This is my version of the VBS:

on error resume next
set WshShell = WScript.CreateObject("WScript.Shell")
Dim A
Dim Ag
Set Ag=Wscript.Arguments
If Ag.Count > 0 then
For x = 0 to Ag.Count -1
A = A & Ag(x)
Next
End If
Set FSO = CreateObject("Scripting.FileSystemObject")
f=FSO.GetFile(A)
set lnk = WshShell.CreateShortcut(A)
If lnk.hotkey <> "" then
msgbox A & vbcrlf & lnk.hotkey
End If

When there is a long pause, it means it is finding nothing. That is, your
assumptions are correct
--
Cheers,
Trevor L.


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
in microsoft.public.windowsxp.customize:

[something to reveal user-defined hotkeys in shortcuts]

Belated thanks, Trevor, for your response.

The script you supplied works great for modified letter keys such
as Ctrl-Alt-W and Shift-Ctrl-Alt-E. For modified non-letters,
however, it displays the modifiers but not the actual key. For
example, Ctrl-Alt-[ opens my default printer. The script displays
Alt-Ctrl- and not Alt-Ctrl-[.

I'm a rank beginner in XP's WSH, but looking at your script I can't
see any reason why a non-letter sould be cut off like that. Knowing
what the behavior is, can you see what's wrong?
 
Stan,

Sorry, I am not knowledgeable enough in scripts to know why special
characters don't display.

I obtained the script from this newsgroup. Perhaps, the person who supplied
it may know - if only I could remember who it was! :-).

With a bit of luck, they may find this discussion and reply to you. I am
also curious. Otherwise, I may search through my correspondence (and the
newsgroup itself) to see who it was. It may not take me too long
--
Cheers,
Trevor L.


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
I gave it to you. That's just the way it works. The system only returns the modifiers.
 
I gave it to you. That's just the way it works. The system only returns the modifiers.

At the risk of sounding like a broken record, I'll repeat my query,
then:

Does anyone know of a free utility program that can list the user-
defined hotkeys and what they point to?
 
At the risk of sounding like a broken record, I'll repeat my query,
then:

Does anyone know of a free utility program that can list the user-
defined hotkeys and what they point to?

Okay, I got off my lazy butt :-) and did a Web search. I found
Shortcut Key Explorer, a free program at RJL Software:
http://www.rjlsoftware.com/software/utility/shortcutkeys/

It found every shortcut key in my Start Menu. I don't have any in
desktop shortcuts so I don't know whether I checked that or not.

The program is very fast, and the cost can't be beat. There's a
handy "double-click to edit" feature. One problem (which I have
communicated to the author) is that something like Ctrl-Shift-Alt-E
is reported as simply E; Ctrl-Alt combinations are reported
correctly.
 
F*ckhead. As the standard says only C + A + 0-9, a-z, F1-F12 there is no need to list those keys. They are win98 comppatable keys.
 
You are still being you rude, arrogant and foulmouthed self I see...
Why don't you take time out to see yourself as others see you...
Exactly what are you trying to prove?
The message would have got across just as well _without_ the expletive...


"David Candy" <.> wrote in message
F*ckhead. As the standard says only C + A + 0-9, a-z, F1-F12 there is no
need to list those keys. They are win98 comppatable keys.
 
Back
Top