Why does this not work

Page 2 of 7 FirstFirst 1234 ... LastLast

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

    Thanks to al 3 of you: I obviously have my work cut out, with my additions (in HKCU\...folder or ...Directory) mixed in with those of installed programs, saved variously in HKLM & HKCU (not to mention the change of order depending on the folder contents). My additions have always ended up in 'top' because I didn't know about the option (and being mine, they are the most important, so will stay on top). I don't think I should spend any more time on this.

    NB: I have always added mine using vbs, so the script can have commented-out lines for removing the entries when not required.
      My Computer


  2. Posts : 7,606
    Windows 10 Home 20H2
       #12

    mngerhold said:
    NB: I have always added mine using vbs, so the script can have commented-out lines for removing the entries when not required.
    In a CMD script, use REM or :: to comment out lines.
      My Computer


  3. Posts : 16,913
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #13

    mngerhold said:
    I have always added mine using vbs, so the script can have commented-out lines for removing the entries when not required.

    And in a .reg file, you start a comment line with
    Code:
    ;

    Denis
      My Computer


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

    But neither of those options will remove an entry! What I meant was this:
    Code:
    WSHShell.RegWrite "HKCU\Software\Classes\Directory\shell\rename_files\command\", "c:\program files\utils\rename.exe %1"
    'WSHShell.RegDelete "HKCU\Software\Classes\Directory\shell\rename_files\command\"
    'WSHShell.RegDelete "HKCU\Software\Classes\Directory\shell\rename_files\"
    so removing the leading apostrophe removed the lines. Not elegant, but it saved delving into the registry, or learning how to add a 'remove' to a .reg file (I know now, having just looked it up: add a hyphen at the start of the line, or after "value=" or somesuch).

    I should add I first did this 15 years ago on partially locked work PCs, where Regedit was not available (but for some reason I wasn't going to question, vbs scripts were permitted!).
      My Computer


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

    mngerhold said:
    But neither of those options will remove an entry!
    ; bmp file - remove Context menu, New entry
    ;[-HKEY_CLASSES_ROOT\.bmp\ShellNew]

    The ; comments out my .reg file entry for removing a particular entry.

    Denis
      My Computer


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

    Denis: yes, I see - if I had started using .reg files that is probably what i would have done. Martin
      My Computer


  7. Posts : 7,606
    Windows 10 Home 20H2
       #17

    Reg delete "HKCU\Software\Classes\Directory\shell\rename_files\" /f

    In a CMD script, the above line will delete \rename_files\, while the following will not.

    :: Reg delete "HKCU\Software\Classes\Directory\shell\rename_files\" /f


    :: denotes "Comment out". /f denotes "Force overwriting".
      My Computer


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

    Thanks Matthew - I responded too quickly without thinking! I'm just stuck in the one groove.
      My Computer


  9. Posts : 7,606
    Windows 10 Home 20H2
       #19

    How would you write the following in VBScript?

    Code:
    (REG ADD "HKCR\.lnk_elevated\ShellNew" /V "Command" /T REG_SZ /D "schtasks /run /tn ""Apps\Create_an_elevated_shortcut""" /F)

    The above syntax has actually been used in the script in the tutorial below:
    How to Add Create Elevated Shortcut to New Context Menu in Windows 10
      My Computer


  10. Posts : 16,913
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #20

    mngerhold, Matthew,

    Please may I take advantage of your continuing involvement in this thread for a moment.

    Was my conclusion in my post #5 correct, is adding a script of my own to a context menu as easy as this?
    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""
    {This is expressed as a .reg file. I know I have reg cmds and vbs alternative methods}

    If it can really be that simple then I will also investigate refinements [dividers, submenus, ...] but I would appreciate knowing that I have interpreted this thread correctly so I know that I have a solid basis for further learning.

    Denis
      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 14:29.
Find Us




Windows 10 Forums