find/delete hotkey for shortcut assigned to program

M

Max Bleuler

hi,

i try to make a hotkey for a shortcut. The shortcut starts a dos_program.

I can make the shortcut but i can not assign a hotkey for it. I use
this for other programs with no problem. But since i upgraded this
dos_program it will not let me use a hotkey. There must be a hotkey
assigned already somewhere.

How can i find assigned hotkeys and delete them?
 
G

Guest

Hi,

right click on the short cut and then choose properties.
then in the window that appears you will see the text box to enter the short
cut.
press any key and the ctrl-alt-<your selected key> will appear and that will
be the short cut key.

Regards
M. Rajesh
..Net and Windows Shell MVP
www.winxpsolution.com
 
M

Max Bleuler

Hi,

Yes i did that with other programs. But this time it does not let me
enter a letter in the ctrl-alt-<your selected key> sequence. It seams
that some letter is assigned already to it in another shortcut (.pif)
but I was not able to find it.

Does anybody know where that information get stored, may be a registry key?
 
D

David Candy

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 %A in (*.lnk) do findhotkey.vbs "%1"
for %A in (*.pif) do findhotkey.vbs "%1"
for %A in (*.url) do findhotkey.vbs "%1"
cd %AllUsersProfile%\desktop
for %A in (*.lnk) do findhotkey.vbs "%1"
for %A in (*.pif) do findhotkey.vbs "%1"
for %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.
 
R

Ramesh [MVP]

Hi David!

--
Ramesh, Microsoft MVP
Window XP Shell/User
http://www.mvps.org/sramesh2k


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 %A in (*.lnk) do findhotkey.vbs "%1"
for %A in (*.pif) do findhotkey.vbs "%1"
for %A in (*.url) do findhotkey.vbs "%1"
cd %AllUsersProfile%\desktop
for %A in (*.lnk) do findhotkey.vbs "%1"
for %A in (*.pif) do findhotkey.vbs "%1"
for %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.
 
M

Max Bleuler

Hi David,

thanks for the info, this helps me.
I tried your code but it did not work right away. I changed already the
"for" line to:

for %A in (*.pif) do findhotkey.vbs "%A"

Now it shows all the (*.pif) files in the directory. But there must be
some other typo in findhotkey.vbs . I have to dig up vbs syntax and
will try tonight. At least i know where to look for by hand. On
Windows98 i can assign a hotkey only on one place. On XP it seems i can
assign it many times but XP gets confused with that.

Thank you
Max
 
D

David Candy

XP doesn't check hotkeys when entered. A hotkey is a shortcut property. It is tied to the file. Hotkeys that you press are worked out on bootup from the shortcuts windows can find (I think it's the first shortcut found with that key).

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).
 
M

Max Bleuler

Hi David,

I had to change findhotkey.vbs a little to get it running. Here is the
final version of it. Works great to find those hotkeys.

' display shortcut hotkeys in *.lnk, *.pif, *.url
'
on error resume next
set objShell = WScript.CreateObject("WScript.Shell")
set Ag = WScript.Arguments
set lnk = objShell.CreateShortcut(Ag(0))
If lnk.hotkey <> "" Then
WScript.Echo Ag(0) & vbcrlf & vbcrlf & "HotKey=" & lnk.hotkey
End If

I call it with:
for %A in (*.url) do c:\findhotkey.vbs "%A"


Thanks a lot for your help
Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top