0

I have a weird situation here.

SUMMARY:

  • Created a Powershell script
  • Created a file shortcut to run it (target is powershell.exe with path to my script passed as a parameter)
  • Bound a keyboard shortcut to that file shortcut (using the properties dialog of the file shortcut)
  • Later renamed the underlying Powershell script
  • After that, pressing the keyboard shortcut causes Windows to try to run the non-existent script (Windows tries to execute the old script filename)
  • Can't rebind the keyboard shortcut to a new file shortcut -- pressing the sequence just causes Windows to try to run the original file again, it doesn't rebind to the new file shortcut

So now I have a globally-available keyboard shortcut that tries to execute a non-existent script, and the keyboard shortcut cannot be bound to a new command and cannot be unbound. It is apparently orphaned.

Things I have tried:

  • Renamed the .ps1 file back to its original name and updated the file shortcut target to point back to it. Press CTRL+ALT+S and the script is executed properly. So clearly Windows is somewhere pointing CTRL+ALT+S to the original .ps1 filename.

  • Deleted the file shortcut and recreated it. The keyboard shortcut field in the properties dialog says None so I tried to set it by clicking in the field and pressing CTRL+ALT+S but that just causes Windows to try to run the original file shortcut again, which fails. It refuses to set the keyboard shortcut in the new file shortcut to that sequence.

Also tried various combinations of things like the above but nothing worked, all with similar results.

So now I have a shortcut key that is bound to nothing and I can't find a way to unbind it.

Where is this binding located?

4
  • What process exactly did you use to bind this custom shortkey originally? "using the properties dialog of the file shortcut" - I have been using Windows since Windows 3.1, and checked to see if I could find anything matches this description, and I was unable to find it.
    – Ramhound
    Commented Dec 8, 2016 at 19:59
  • @Ramhound when you right-click a file shortcut and select Properties and look under the Shortcut tab there is a text field labeled Shortcut key. Once that field has focus you can enter a key chord and it will bind that shortcut. Regardless I just found the solution after digging a bit more, will post an answer momentarily.
    – Dave
    Commented Dec 8, 2016 at 20:05
  • Didn't look hard enough and honestly never used it in all those years. You just can hit backspace on that field and it sets it to None
    – Ramhound
    Commented Dec 8, 2016 at 20:07
  • @Ramhound yeah but the problem was the original shortcut had been deleted. I left what I thought was a minor detail out of the description but it turned out to be the most important. I had pinned the shortcut to the taskbar, then unpinned it. Windows copies shortcuts to the taskbar folder, not just pointers but the whole thing. So editing the original shortcut file won't change anything. When it was unpinned it for some reason left the original in the taskbar folder but didn't show it on the taskbar. Not sure why. Found it and deleted it, problem solved. No more 'ghost' hanging around.
    – Dave
    Commented Dec 8, 2016 at 20:10

1 Answer 1

2

I found the answer so I'm leaving this here in case anyone else runs into this situation. The trick here was that I had pinned the created shortcut to the Windows taskbar which initially I didn't think was a relevant detail. It turns out that was a huge detail.

When pinning a shortcut to the taskbar Windows doesn't create a pointer to your shortcut, it actually copies the shortcut into this folder:

Taskbar shortcuts are located in: %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar.

You can also add the "Quick Launch" folder to your task bar as a toolbar to re-enable the quick launch feature.

That location had the previous copy of that file shortcut. It is also one of the paths searched for registered shortcut keys. Deleting it did the trick.

There are only a few possible locations for that shortcut:

  • the desktop (%USERPROFILE%\Desktop, %PUBLIC%\Desktop)
  • the start menu (%APPDATA%\Microsoft\Windows\Start Menu, %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu)
  • the quick launch bar

(all user and system wide, of course)

Refs:

Where are the shortcuts for the Windows 7 Taskbar stored on disk?

How do I find the shortcut that is using a specific keyboard shortcut?

1
  • @LotPings yep I tried that when I wrote it and I have to wait a couple days, will try to remember to do it. :) Thanks.
    – Dave
    Commented Dec 9, 2016 at 0:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .