Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Windows is there a way to find all shortcuts for a given file/application? This is something I hope to eventually execute programmatically.

share|improve this question

5 Answers 5

Programmatic solution:

findstr /ism notepad.exe \*.lnk

findstr.exe comes bundled with Windows since XP if not earlier. It lives in c:\windows\system32.

  • /i specifies case-insensitive search
  • /s specifies recursive search descending into subfolders
  • /m specifies 'display only the file name when matches are found'. Without this option, findstr will spit out a bunch of ascii-translated binary garbage

notepad.exe is the target of the shortcut, replace with the actual executable you're interested in.

c:*.lnk gets implicitly split into two parts: "\" specifying the root of the search, and "*.lnk" specifying the files to search.

share|improve this answer

You can search for *.lnk files that contain the path or executable name.

For example: look for files *.lnk that contain notepad.exe

I tried using Windows 7 search notepad.exe kind:*.lnk and couldn't get it to work all the time. I think it may have problems with the non-indexed directories. I tried some setting changes and if I was close I got it to work, but if I went to the root of a drive I didn't get it to work.

I did have luck using UltraEdit, but I'm sure there are other (free) text editors out there that will search directories/subdirectories.

Of course depending on how unique of a search you make and the program/folder name, you could get false positives. But this should find all the shortcuts to the target you were looking for, that you have permissions to see and read. (i.e. A user may have one on his/her desktop and you not have permission to see that user's desktop.)

Hope this helps.

EDIT: I just found TextCrawler, I hadn't tried it, but it may be able to do the search I described.

share|improve this answer

Sorry I can't ask you what programming env. you're using. However, I do know about this Windows Script Host COM reference.

http://msdn.microsoft.com/en-us/library/xk6kst2k(VS.85).aspx

Additionally, I don't think I ever say it mentioned in the documentation, but if you want to "read" a shortcut, you use the same WshShell.CreateShortcut command to "open" the shortcut file, then just call variable.TargetPath to get the value.

I've seen some references also on how to do this in PowerShell, although it looked even more complicated than these examples.

share|improve this answer

Keyboard shortcuts for Microsoft programs: http://www.microsoft.com/enable/products/keyboard.aspx

This URL covers:

  • All the Windows operating systems back to Windows Server 2003.
  • Microsoft Office Suite (and all the programs within) 2003, 2007, & 2010
  • Internet Explorer 6, 7, 8
  • Windows Media Center, Windows Media Player 11 & 12.

And if you want to find them for a specific program, just google the name of the program along with the release number and keyboard shortcuts.

e.g.: Mozilla Firefox 3.6 keyboard shortcuts

share|improve this answer
1  
I think the asker meant Shortcut Files not keyboard shortcuts –  jay Oct 9 '10 at 6:54
    
@jay: thanks!.. –  studiohack Oct 9 '10 at 16:12

Open the start menu/button, and enter: type: *.lnk in the search/run field at the bottom. Click "see more results" in blue, now just above that.

A new explorer window will open. Change the file-view to "Detailed".

Right-click the "title"bars for each category, and add "Link target" to the fields shown (you will likely need to click "more" and find it in the alphabetical list)

Now click on the Link target "title"bar to sort by Link target, and find all your windows-shortcut-files that point to your target file.

This should show all variations of command-line flags, since you're sorting alphabetically by target path.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.