Community
    • Login

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

    Scheduled Pinned Locked Moved Announcements
    42 Posts 16 Posters 13.2k Views
    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
      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
        Alex Povolotsky
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote -5
        • PeterJonesP PeterJones locked this topic on
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors