Setting Notepad++ as default text editor requires changing a reg key

Page 2 of 2 FirstFirst 12

  1. Posts : 425
    Windows 10
    Thread Starter
       #11

    What is the correct syntax for regini?


    Thanks all.
    I don't have a hash key, but I do want the ProgId key. Without the Hash key Notepad does show up on the list of choosable programs to open a file with, so I don't know what the hash key does.

    Problem is the registry key permissions restrict changes. As I said, easy enough to change within regedit, but I want to use RegIni to change if from the command line. I just can't seem to get the syntax of that command right.

    I did give SetuserFTA a try, but it fails I suspect because the script I'm running runs with administrative privileges, and as stated on the utilities webpage...

    IMPORTANT: SetUserFTA must run in the users context – no administrative or system privileges
    Last edited by Wobitancrawfodi; 19 May 2020 at 21:03. Reason: typo
      My Computer


  2. Posts : 989
    Microsoft Windows 10 Home
       #12

    1. Why not use PowerShell and Set-Acl?
    2. If you want to use regini, the path and permisssions go in the .txt file, so the contents of test.txt would be:
      Code:
      HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\fileexts\.txt\userchoice [1 5 7]
    3. And then simply execcute: regini test.txt
      My Computer


  3. Posts : 425
    Windows 10
    Thread Starter
       #13

    KeithM said:
    1. Why not use PowerShell and Set-Acl?
    2. If you want to use regini, the path and permisssions go in the .txt file, so the contents of test.txt would be:
      Code:
      HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\fileexts\.txt\userchoice [1 5 7]
    3. And then simply execcute: regini test.txt
    Ahh.. And here I was thinking it could all be done in one command. First the regini to change the permissions, then the reg add command to add the progId key. Got it.
      My Computer


  4. Posts : 989
    Microsoft Windows 10 Home
       #14

    Wobitancrawfodi said:
    Ahh.. And here I was thinking it could all be done in one command. First the regini to change the permissions, then the reg add command to add the progId key. Got it.
    You should be able to add ProgId to test.txt
    Have you looked at https://support.microsoft.com/en-us/...mand-line-or-a?

    It's incomplete & somewhat confusing, but it's how I figufred out the syntax.
      My Computer


  5. Posts : 425
    Windows 10
    Thread Starter
       #15

    Yes I did see that link.
    And also
    REGINI - Windows CMD - SS64.com

    When I added ProdID to test.txt it failed again.

    Anyway, I can live with the two step process of regini to change the permissions and reg add to add the key,
      My Computer


  6. Posts : 989
    Microsoft Windows 10 Home
       #16

    Wobitancrawfodi said:
    Yes I did see that link.
    And also
    REGINI - Windows CMD - SS64.com

    When I added ProdID to test.txt it failed again.
    Weird. What syntax did you use? Just tested this & it worked for me:
    Code:
    HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\fileexts\.txt\userchoice [1 5 7]
    "ProgID"="txtfile"
    Console dislpay:
    Code:
    PS C:\...\RegIni>get-content test.txt
    HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\fileexts\.txt\userchoice [1 5 7]
    "ProgID"="txtfile"
    PS C:\...\RegIni>gci 'HKCU:\software\microsoft\windows\currentversion\explorer\fileexts\.txt'
    
        Hive: HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\fileexts\.txt
    
    
    Name                           Property
    ----                           --------
    OpenWithList                   a       : NOTEPAD.EXE
                                   b       : acghfedb
                                   c       : a
                                   d       : PickerHost.exe
                                   e       : {F38BF404-1D43-42F2-9305-67DE0B28FC23}\explorer.exe
                                   f       : WORDPAD.EXE
                                   g       : notepad++.exe
                                   h       : chrome.exe
                                   i       : gabcdefhi
                                   MRUList : agbcdefhi
                                   j       : soffice.bin
    OpenWithProgids                txtfile        : {}
                                   Notepad++_file : {}
    
    
    PS C:\...\RegIni>regini test.txt
    HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\fileexts\.txt\userchoice [1 5 7]
        ProgID = txtfile
    PS C:\...\RegIni>gci 'HKCU:\software\microsoft\windows\currentversion\explorer\fileexts\.txt'
    
        Hive: HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\fileexts\.txt
    
    
    Name                           Property
    ----                           --------
    OpenWithList                   a       : NOTEPAD.EXE
                                   b       : acghfedb
                                   c       : a
                                   d       : PickerHost.exe
                                   e       : {F38BF404-1D43-42F2-9305-67DE0B28FC23}\explorer.exe
                                   f       : WORDPAD.EXE
                                   g       : notepad++.exe
                                   h       : chrome.exe
                                   i       : gabcdefhi
                                   MRUList : agbcdefhi
                                   j       : soffice.bin
    OpenWithProgids                txtfile        : {}
                                   Notepad++_file : {}
    userchoice                     ProgID : txtfile
    
    
    PS C:\...\RegIni>
      My Computer


  7. Posts : 425
    Windows 10
    Thread Starter
       #17

    HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\fileexts\.txt\userchoice [1 5 7] ProgID=Applications/Notepad++

    That's one line. This is about setting the UserChoice key value.
      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 11:41.
Find Us




Windows 10 Forums