none
Hotkey folders in Windows 7

    שאלה

  • What folders are valid for Windows 7 shortcut keys? For example, say I want to assign Ctl+Alt+C to call up the Calculator, and Ctl+Alt+R to bring up Excel and see MySpreadsheet.xls.  I know how to assign a key combo to a .lnk file via Properties, but I'm looking for information on where that .lnk file has to be for the key combo to be recognized and bring up the app. I think these 4 are valid:

    C:\Users\Public\Desktop
    C:\Users\username\Desktop
    C:\ProgramData\Microsoft\Windows\Start Menu
    C:\Users\username\Start Menu

     - but I'm getting inconsistent results when I store the .lnk files within subfolders there. Typically the keys work until I reboot, then they don't, as if they were stored in memory but not persistent. Advice or article pointers appreciated.

    יום ראשון 10 יוני 2012 17:01

כל התגובות

  • Based on my test, if we move the lnk file to other location, the shortcut keys will not work. ( I have not rebooted the system.)  And the *.lnk files modified the shortcut keys are valid on desktop, but other locations such as D:\ are invalid.

    Ivan-Liu

    TechNet Community Support

    יום שלישי 12 יוני 2012 08:25
  • Thanks! Yes, I think those four locations are the only ones where shortcut keys are consistently valid.

    Now, how do I find those folders in Visual Basic 2010?

    My.Computer.FileSystem.SpecialDirectories.Desktop   returns the value of the user's Desktop folder.

    But that leaves the user's Start menu folder, and "All users'" two folders (desktop and start menu); I'm looking for the object that returns those values.

    יום שלישי 12 יוני 2012 20:26
  • I should qualify that, since I found the All Users desktop folder. For anyone interested, this use of the Windows Script Host does it in VB:

    Imports WSH = IWshRuntimeLibrary

    .....

    Dim allUsersDesktop As Object = "AllUsersDesktop"
    Dim shell As WSH.WshShell = New WSH.WshShell()
    Dim desktopFolder As String = shell.SpecialFolders.Item(allUsersDesktop).ToString()

    So I just need to find the two Start Menu folders.

    יום שלישי 12 יוני 2012 20:42
  • Hi,

    You'd better redirect to MSDN forum for further assistance. Or Script Center forum.

    http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/threads

    http://social.technet.microsoft.com/Forums/en/ITCG/threads/


    Ivan-Liu

    TechNet Community Support

    יום רביעי 13 יוני 2012 01:33
  • Good point, and I'll probably do that in time; but the issue of how to access the folders in a program is IMHO a little separate from where _are_ the folders that can validly store hotkeys. I'm finding that not all of those locations are included in programmable methods and properties, so first I need to enumerate them to avoid missing some. For example, this afternoon I discovered another location:

    C:\Users\username\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu

    Entirely separate from   C:\Users\username\Start Menu  but the hotkeys function. It's a little surprising there is no list of the valid folders.

    יום רביעי 13 יוני 2012 02:58
  • To wrap this up, I think the following seven folders are searched for .lnk shortcuts when a Ctrl-Alt-key combo in Windows 7 is pressed.

    C:\Users\username\Desktop
    C:\Users\Public\Desktop
    C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu
    C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
    C:\Users\username\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu
     (notice, no space in "StartMenu" here)
    C:\ProgramData\Microsoft\Windows\Start Menu
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs

    Hope this is helpful. Any questions or comments, post here.

    יום רביעי 13 יוני 2012 21:48