Community
    • 登入

    Context menu entry in the potable version of Notepad++

    已排程 已置頂 已鎖定 已移動 General Discussion
    33 貼文 8 Posters 9.5k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • EkopalypseE
      Ekopalypse @Jaanyaar
      最後由 Ekopalypse 編輯

      @J4NY4R

      Are you sure you used an elevated command prompt?
      When I open a cmd (using Run as administrator), change to the directory where the NppShell file is located and run the above command, I get a new window asking for the settings.
      I set them and it’s done.

      84f61697-883d-48c0-a65d-83cd368a0f03-image.png

      Notepad++ v7.9.2   (32-bit)
      Build time : Dec 31 2020 - 03:58:36
      Path : C:\Portable Programs\Notepad++\notepad++.exe
      Admin mode : OFF
      Local Conf mode : ON
      OS Name : Windows 10 Enterprise (64-bit) 
      OS Version : 2004
      OS Build : 19041.388
      Current ANSI codepage : 1252
      Plugins : mimeTools.dll NppConverter.dll NppExport.dll 
      
      1 條回覆 最後回覆 回覆 引用 2
      • JaanyaarJ
        Jaanyaar
        最後由 編輯

        @Ekopalypse
        Don’t know what wrong was on my side but at last I managed to solve it. Thanks for your time and help.

        1 條回覆 最後回覆 回覆 引用 2
        • JaanyaarJ
          Jaanyaar
          最後由 編輯

          2021-01-07_20-00-01.png

          Although I have the shell entry now, but I can’t open any file with it!

          1 條回覆 最後回覆 回覆 引用 0
          • prahladmifourP
            prahladmifour
            最後由 編輯

            Hello,@Jaanyaar
            Please follow this information, To Context menu entry in the portable version of Notepad++.
            The first thing you’ll want to do is open up regedit.exe through the Start Menu search or run box, and then browse down to the following key: HKEY_CLASSES_ROOT\Directory\Background\shell
            Registry Editor
            registryeditor.PNG

            The screen should look similar to this one if you are in the right place.

            Next, you’ll want to create a new key underneath the shell key, the name of which is exactly what is going to show up on the desktop menu. Right-click on the “shell” key, and then choose New \ Key from the menu.

            Give the new key the name that you want to show up on the desktop context menu. For this example, we’ll be using Open with Notepad++.

            Next, you’ll need to create the command key that will actually hold the command used to launch the application. Right-click on the new Notepad++ key, and then choose New \ Key from the menu.

            Registry Editor
            AddRegistry.PNG

            Give this key the name “command” in lowercase.

            To complete this step you’ll need the full path to the application that you want to launch. You can use Shift + Right-Click to get the Copy as Path menu item to find this more quickly.

            Now click on “command” on the left side, and then double-click on the (Default) key on the right side to edit the string value.

            Paste in the full path to the executable that you got from the “Copy as Path” step above, or you can put in the full path yourself if you’d like.

            And right-clicking on the desktop will produce the new menu item… naturally, using this menu item should launch Notepad++.

            You can add as many applications to the desktop context menu as you’d like, just repeat the steps with a new menu item name.

            It is basically the same for other Windows versions too.

            I hope this information will be useful to you.
            Thank you.

            1 條回覆 最後回覆 回覆 引用 0
            • JaanyaarJ
              Jaanyaar
              最後由 編輯

              @prahladmifour Thanks!

              I did realize what the cause of my error message was. Notepad++ was set to run as Administrator, using the context menu entry in this situation leads to the above error.

              Alan KilbornA dinkumoilD 2 條回覆 最後回覆 回覆 引用 4
              • Alan KilbornA
                Alan Kilborn @Jaanyaar
                最後由 編輯

                @Jaanyaar said in Context menu entry in the potable version of Notepad++:

                I did realize what the cause of my error message was. Notepad++ was set to run as Administrator, using the context menu entry in this situation leads to the above error.

                This makes sense, although the error message received is not helpful:
                Your Explorer is running non-admin. When it tries to tell an admin-level N++ to run/switch-to N++, N++ says “I can’t do that because you are not important enough”.

                Good that it is now working for you @Jaanyaar

                1 條回覆 最後回覆 回覆 引用 5
                • dinkumoilD
                  dinkumoil @Jaanyaar
                  最後由 dinkumoil 編輯

                  @Jaanyaar @Ekopalypse @Alan-Kilborn

                  For the records:

                  When installing the Notepad++ shell extension manually, one has to choose the version of the DLL with the same bitness like the Explorer itself, i.e. the bitness of his Windows installation. Since 32 bit Notepad++ can be installed on both 32 bit and 64 bit Windows, its installer contains two versions of NppShell_06.dll, a 32 bit and a 64 bit version. I guess @Jaanyaar luckily choose the correct one in his second attempt to install the shell extension.

                  @Alan-Kilborn

                  the error message received is not helpful

                  Unhelpful and/or uncertain error messages are a well-known feature of Notepad++, aren’t they? ;-) Especially I think for Plugins Admin error messages. I even filed an issue regarding that a long time ago - nothing happened.

                  1 條回覆 最後回覆 回覆 引用 4
                  • ?
                    舊使用者
                    最後由 舊使用者 編輯

                    For me, the command above (except now it’s not NppShell_01.dll but NppShell.dll) produced error:

                    The module "NppShell.dll" was loaded but the entry-point DllInstall was not found. 
                    
                    Make sure that "NppShell.dll is a valid DLL or OCX file and then try again. 
                    

                    What fixed it was to remove the /i option, and run as regsvr32.exe NppShell.dll , as said at https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13439#issuecomment-1499289606.

                    (windows 32 bit , N++ 8.5.4)

                    Maybe in future they’ll ship the correct dll with the portable version https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13935

                    1 條回覆 最後回覆 回覆 引用 0
                    • ?
                      舊使用者 @Alan Kilborn
                      最後由 舊使用者 編輯

                      此回覆已被刪除!
                      1 條回覆 最後回覆 回覆 引用 0
                      • ?
                        舊使用者
                        最後由 舊使用者 編輯

                        One thing that confuses me is that most answers on getting this context-menu for Portable-version users require Admin rights. Then why these users still prefer Portable and not Installer version?

                        @Ekopalypse

                        But I think this should also ship with the portable version.
                        What do you think, worth opening an FR?

                        Though that will help, maybe an even better solution is to be shipped with a .reg file or a .dll specifically for users without admin-rights, that they can run to get this functionality easier?

                        rdipardoR 1 條回覆 最後回覆 回覆 引用 0
                        • rdipardoR
                          rdipardo @舊使用者
                          最後由 編輯

                          You may be interested in the Scoop package manager. All software goes into %USERPROFILE%\scoop\apps by default, with support for multiple versions (a shortcut named current always points to the latest version).

                          Many packages come with Registry scripts for more convenient system integration (see the “Notes” field below).

                          > scoop info notepadplusplus
                          
                          
                          Name        : notepadplusplus
                          Description : A free source code editor and Notepad replacement that supports several languages.
                          Version     : 8.5.4
                          Bucket      : extras
                          Website     : https://notepad-plus-plus.org
                          License     : GPL-3.0-or-later
                          Updated at  : 2023-06-18 12:26:57 PM
                          Updated by  : github-actions[bot]
                          Binaries    : notepad++.exe
                          Shortcuts   : Notepad++
                          Notes       : Add Notepad++ as a context menu option by running: reg import "<root>\install-context.reg"
                          
                          ? 1 條回覆 最後回覆 回覆 引用 0
                          • ?
                            舊使用者 @rdipardo
                            最後由 編輯

                            @rdipardo Thanks for the tip, but I don’t have/install that many apps to need a special manager.

                            rdipardoR 1 條回覆 最後回覆 回覆 引用 0
                            • rdipardoR
                              rdipardo @舊使用者
                              最後由 編輯

                              All the same, I think any feature request for a more system-integrated portable version is better placed with a project that deals exclusively with packaging. Scoop and winget are just the first two that come to mind. There’s even a close-sourced project distributing MSI installers.

                              1 條回覆 最後回覆 回覆 引用 0
                              • 第一個貼文
                                最後的貼文
                              The Community of users of the Notepad++ text editor.
                              Powered by NodeBB | Contributors