Community
    • Login

    Notepad++ v8.3.2 release - Declare variables, not war

    Scheduled Pinned Locked Moved Announcements
    42 Posts 16 Posters 35.4k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Vitalii DovganV Offline
      Vitalii Dovgan @Vitalii Dovgan
      last edited by

      @vitalii-dovgan said in Notepad++ v8.3.2 release - Declare variables, not war:

      Hmm, I tried to reproduce it today with different scenarios - and could not. Though it was stably reproducible yesterday.

      Now I’m having a strong confidence that the issue was connected to improper invocation of Notepad++ from my side. Sorry for the previous misleading.

      Anyway, as the result I’ve created a batch script that can be used to add a context menu item “Edit with Notepad++” for a single file and “Open in Notepad++” for a folder, using either a portable or an installed version of Notepad++. If interested, you can place this file directly into the Notepad++ folder and run it there.

      The content of “npp_context_menu.cmd” :

      @echo off
      
      echo Initialization...
      set EXEDIR=%~dp0
      set "EXE=%EXEDIR:\=\\%notepad++.exe"
      set REGFILE=npp_context_menu.reg
      
      if exist "%REGFILE%" del "%REGFILE%"
      
      echo Writing "%REGFILE%"...
      1>>"%REGFILE%" echo Windows Registry Editor Version 5.00
      1>>"%REGFILE%" echo.
      1>>"%REGFILE%" echo [HKEY_CLASSES_ROOT\*\shell]
      1>>"%REGFILE%" echo.
      1>>"%REGFILE%" echo [HKEY_CLASSES_ROOT\*\shell\notepadpp_edit_file]
      1>>"%REGFILE%" echo @="Edit with &Notepad++"
      1>>"%REGFILE%" echo "Icon"="\"%EXE%\",0"
      1>>"%REGFILE%" echo.
      1>>"%REGFILE%" echo [HKEY_CLASSES_ROOT\*\shell\notepadpp_edit_file\command]
      1>>"%REGFILE%" echo @="\"%EXE%\" -nosession \"%%1\""
      1>>"%REGFILE%" echo.
      1>>"%REGFILE%" echo [HKEY_CLASSES_ROOT\Directory\shell]
      1>>"%REGFILE%" echo.
      1>>"%REGFILE%" echo [HKEY_CLASSES_ROOT\Directory\shell\notepadpp_edit_folder]
      1>>"%REGFILE%" echo @="Open in &Notepad++"
      1>>"%REGFILE%" echo "Icon"="\"%EXE%\",0"
      1>>"%REGFILE%" echo.
      1>>"%REGFILE%" echo [HKEY_CLASSES_ROOT\Directory\shell\notepadpp_edit_folder\command]
      1>>"%REGFILE%" echo @="\"%EXE%\" -multiInst -nosession -openFoldersAsWorkspace \"%%1\""
      1>>"%REGFILE%" echo.
      
      REM Converting to UCS-2 LE (not mandatory)
      if exist "%~dp0..\sfk\sfk.exe" set PATH=%PATH%;%~dp0..\sfk
      sfk atow "%REGFILE%" -tofile "%REGFILE%"
      
      if not exist "%REGFILE%" goto ErrorNoRegFile
      
      echo Registering "%REGFILE%"...
      start "Registering %REGFILE%" "%REGFILE%"
      goto Done
      
      :ErrorNoRegFile
      echo ERROR: "%REGFILE%" does not exist!
      pause
      goto Done
      
      :Done
      
      

      This invokes Notepad++ using its -nosession command line argument to not affect the opened file history (this is especially useful when opening a folder).

      1 Reply Last reply Reply Quote 2
      • Alex PovolotskyA Offline
        Alex Povolotsky
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote -5
        • PeterJonesP PeterJones locked this topic on

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors