On Windows is there a way to find all shortcuts for a given file/application? This is something I hope to eventually execute programmatically.
|
feedback
|
|
Programmatic solution:
findstr.exe comes bundled with Windows since XP if not earlier. It lives in c:\windows\system32.
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. | ||||
|
feedback
|
|
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 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. | ||||
|
feedback
|
|
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. | |||
|
feedback
|
|
Keyboard shortcuts for Microsoft programs: http://www.microsoft.com/enable/products/keyboard.aspx This URL covers:
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.: | |||||||
feedback
|
