Why does this not work

Page 1 of 7 123 ... LastLast

  1. Posts : 13,934
    Windows 10 Pro X64 21H1 19043.1503
       #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 : 3,990
    Windows 10 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #2

    Just an educated guess -

    Environment Variables?

      My Computer


  3. Posts : 13,934
    Windows 10 Pro X64 21H1 19043.1503
    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 : 958
    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 : 11,387
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #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 : 889
    W10-2009 19042.1348
       #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,456
    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,831
    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 : 16,017
    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,456
    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 08:33.
Find Us




Windows 10 Forums