Why does this not work

Page 1 of 7 123 ... LastLast

  1. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #1

    Why does this not work


    I have a .reg and bat file that I thought used to work but doesn't work right any more. It only works if I shift+right click on a file, but not on a directory.


    AddisItaLink.reg:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\isLink]
    @="Is This a Link"
    "Extended"=""

    [HKEY_CLASSES_ROOT\*\shell\isLink\command]
    @=""C:\\rexxprogs\\isItaLink.bat" "%1""
    I've merged the reg file into the registry:

    C:\Users\ztruk>rq HKEY_CLASSES_ROOT\*\shell\isLink
    ECHO is on.

    C:\Users\ztruk>reg query "HKEY_CLASSES_ROOT\*\shell\isLink"

    HKEY_CLASSES_ROOT\*\shell\isLink
    (Default) REG_SZ Is This a Link
    Extended REG_SZ

    HKEY_CLASSES_ROOT\*\shell\isLink\command

    C:\Users\ztruk>rq HKEY_CLASSES_ROOT\*\shell\isLink\command
    ECHO is on.

    C:\Users\ztruk>reg query "HKEY_CLASSES_ROOT\*\shell\isLink\command"

    HKEY_CLASSES_ROOT\*\shell\isLink\command
    (Default) REG_SZ "C:\rexxprogs\isItaLink.bat" "%1"

    C:\rexxprogs\isItaLink.bat
    fsutil hardlink list %*
    pause
    Here I clicked on a file:

    Why does this not work-image.png

    Here I clicked on a folder:

    Why does this not work-image.png
      My Computers


  2. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #2

    Just an educated guess -

    Environment Variables?

      My Computer


  3. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
    Thread Starter
       #3

    I fixed it. Had to add the Directory entries to the reg file:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\isLink]
    @="Is This a Link"
    "Extended"=""

    [HKEY_CLASSES_ROOT\*\shell\isLink\command]
    @=""C:\\rexxprogs\\isItaLink.bat" "%1""

    [HKEY_CLASSES_ROOT\Directory\shell\isLink]
    @="Is This a Link"
    "Extended"=""

    [HKEY_CLASSES_ROOT\Directory\shell\isLink\command]
    @=""C:\\rexxprogs\\isItaLink.bat" "%1""
      My Computers


  4. Posts : 989
    Microsoft Windows 10 Home
       #4

    You could accomplish the same thing with a single entry under: HKEY_CLASSES_ROOT\AllFilesystemObjects

    Why does this not work-hkcr-namespace-venn-diagram.png

    But you mightt want to also add the command to HKEY_CLASSES_ROOT\Directory\Background​.
      My Computer


  5. Posts : 16,949
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #5

    Ztruker said:
    I fixed it. Had to add the Directory entries to the reg file:
    Rich,

    I have been following this thread in order to learn.

    If I understand you correctly, the only action you have had to take to add references to your batch file in the context menu is that reg file?
    Code:
    Windows Registry Editor Version 5.00
     [HKEY_CLASSES_ROOT\*\shell\isLink]
     @="Is This a Link"
     "Extended"=""
     [HKEY_CLASSES_ROOT\*\shell\isLink\command]
     @=""C:\\rexxprogs\\isItaLink.bat" "%1""
     [HKEY_CLASSES_ROOT\Directory\shell\isLink]
     @="Is This a Link"
     "Extended"=""
     [HKEY_CLASSES_ROOT\Directory\shell\isLink\command]
     @=""C:\\rexxprogs\\isItaLink.bat" "%1""

    If it's that simple, I think I'll tidy my context menu up. I've been dumping shortcuts to all my batch/vbs/ps scripts in the SendTo folder because I had thought that adding them to the context menu itself was much more involved.
    I'll find out how to add a divider line to the context menu aswell and then I'll be set. {Addn - I found the method in Context menu separator lines not showing - TenForums which referred to Add Personalize (classic) context menu - TenForumsTutorials}

    Denis
      My Computer


  6. Posts : 1,223
    W10-Pro 22H2
       #6

    Try3 said:
    I'll find out how to add a divider line to the context menu aswell and then I'll be set.
    If you can find a way to control the order of context menu items, I'd like to hear about it. I've been adding items for some years, but have never got used to where they end up in the list. For example: from two nearby folders in the LH pane I get this:
    Why does this not work-context-1.png and this Why does this not work-context-2.png
    Now I see that the LH folder only has files in it, whilst that on the right has files & a folder, but what gives?

    In addition, it would be helpful if the items were in, say, alphabetical order! I know the source of the items is varied, and it would be tricky to manage rules for showing them, but it would be nice. Until the order is sorted, separators are a minor concern (for me).

    NB I did try EcMenu (recommended here the other day) - perhaps I should look at that more closely?
      My Computer


  7. Posts : 7,607
    Windows 10 Home 20H2
       #7

    mngerhold said:
    If you can find a way to control the order of context menu items, I'd like to hear about it.
    (REG Add "HKCR\DesktopBackground\Shell\ABC\Command" /VE /D "Winver" /F)

    (REG Add "HKCR\DesktopBackground\Shell\Testing\Command" /VE /D "Winver" /F)

    (REG Add "HKCR\DesktopBackground\Shell\Testing2\Command" /VE /D "Winver" /F)

    If you run the above commands, the order will be:

    ABC
    Testing
    Testing2


    Why does this not work-order-items.jpg
      My Computer


  8. Posts : 17,838
    Windows 10
       #8

    The String Position should be Top or Bottom...

    I often move an item further down the alphanumerical hierarchy by adding an invisible character to the beginning of the Key name...

    Why does this not work-000670.png
      My Computer


  9. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #9

    If I use a REG file, I usually adapt it to the position I require by changing it to Top, Middle, or Bottom. Obviously the context menu name, which can also be changed prior to merging is important with regard to the items position in the overall structure!
      My Computer


  10. Posts : 7,607
    Windows 10 Home 20H2
       #10

    I prefer commands to REG files.

    (REG Add "HKCR\Directory\Background\Shell\Testing1" /V "Position" /T REG_SZ /D "Top" /F)

    (REG Add "HKCR\Directory\Background\Shell\Testing2" /V "Position" /T REG_SZ /D "Middle" /F)

    (REG Add "HKCR\Directory\Background\Shell\Testing3" /V "Position" /T REG_SZ /D "Bottom" /F)
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:36.
Find Us




Windows 10 Forums