Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to open specific files in different folder where root folder might be varied. Open File in Solution is my temporary solution.

    Help wanted · · · – – – · · ·
    4
    8
    481
    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.
    • Louis Go
      Louis Go last edited by

      Notepad++ is decent for my paper working.
      I’d like to find a way for open specific files at the same time like the example below.

      Resource files are customized and organized in locale folders.
      I Need to open different files having same name in different locale folders.

      Eg:
      Open “FormString.xml” file in ENG, CHT, CHS folders.
      PS: File name would be varied. It will not always be “FormString.xml”.
      –project folder
      –ENG
      –FormString.xml
      –PopupString.xml
      –CHT
      –FormString.xml
      –PopupString.xml
      –CHS
      –FormString.xml
      –PopupString.xml

      So far I found “Open File in Solution” is near to my goal.
      However I need to switch project locations frequently in SolutionHub is a bit pain in the neck.

      The steps below is in a bit of a hassle.

      1. Open SolutionHub and change the folder
      2. Select the folder in folder dialog. ( Note you can’t pase path, need to clicking all the ways down. )
      3. Save connections.

      Is there a way to dynamically change Solution hub ofis connection folder location for searching?
      Or any other solution is appreciated.

      1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones last edited by

        Sorry, I know nothing about Solution Hub (hadn’t even heard of that plugin until just now).

        If I’ve understood what you want, you may want to look into sessions, which are “a set of files opened in Notepad++”: Save Session and Load Session functionality is built into Notepad++'s File menu. I have heard from others that if you have more than a couple sessions that you want to deal with, the Session Manager plugin (installable through the Plugins > Plugins Admin) is useful.

        Louis Go 1 Reply Last reply Reply Quote 1
        • Louis Go
          Louis Go @PeterJones last edited by

          @PeterJones
          As far as I know save sessions only save in absolute path and cannot fulfill my need above.

          Sorry for not describiing my question clearly.

          I want to open following files at the same time
          C:\solution1\ENG\File.xml
          C:\solution1\CHT\File.xml
          C:\solution1\CHS\File.xml

          Where “C:\solution1” could be “D:\solution2” and “File.xml” could be “Another.xml”
          ENG CHT and CHS folder are fixed in relative location.
          Both root path and file name could be varied and I can’t predict those names.

          Alan Kilborn 1 Reply Last reply Reply Quote 0
          • Alan Kilborn
            Alan Kilborn @Louis Go last edited by

            @Louis-Go

            It sounds to me like a scripting plugin is needed to solve this problem.

            1 Reply Last reply Reply Quote 0
            • guy038
              guy038 last edited by guy038

              Hello, @louis-go, @Peterjones, @alan-kilborn and All,

              Why not a very simple batch file, like below, with the comments inside ?

              @echo off
              
              if NOT %2!==! goto Proc
              
              echo.
              echo.
              echo     Syntax ( 2 PARAMETERS ) :
              echo.
              echo.
              echo         Test.bat (FIRST part of the PATH) (File_NAME)
              echo.
              echo.
              echo.
              echo     Open in NOTEPAD++, the 3 FILES in PARAMETER 2, present UNDER the folders
              echo.
              echo      'ENG', 'CHS' and 'CHT', which are located UNDER the path in PARAMETER 1
              echo.
              echo.
              echo.
              echo     REMARK : If any PARAMETER contains SPACE chars, SURROUND it with 2 "" chars
              echo.
              echo.
              
              goto :EOF
              
              
              :Proc
              
              REM "<Installation PATH>\notepad++.exe" -nosession %1\ENG\\%2 %1\CHT\\%2 %1\CHS\\%2
              
              
              • Delete, at the end, the command REM and replace the part <Installation PATH> with your full pathname to Notepad++.exe

              • Save the modifications

              Enjoy !

              Best Regards,

              guy038

              Louis Go 1 Reply Last reply Reply Quote 3
              • Louis Go
                Louis Go @guy038 last edited by

                @guy038
                guy038 Thanks!
                It’s the simplest solution. I was digging in the wrong direction too deep.

                1 Reply Last reply Reply Quote 0
                • Louis Go
                  Louis Go last edited by Louis Go

                  This is my right click on a file solution.
                  It comes up with @guy038 's suggestion.
                  If anyone need to use it.

                  1. Change the reg file location to where you put batch file.
                  2. Change the batch file XXNotePadPPPath to your actual notepad++ path.
                  3. Right click on any file will do the work.

                  Batchfile

                  setlocal
                  
                  FOR %%i IN (%1) DO (
                  echo filedrive=%%~di
                  echo set filepath=%%~pi
                  echo filename=%%~ni
                  echo fileextension=%%~xi
                  
                  set XXFilePath=%%~di%%~pi
                  set XXFilename=%%~ni%%~xi
                  )
                  
                  set XXRootPath=%XXFilePath%..\\..
                  set XXEngPath=%XXRootPath%\\Common\\String_CncEngs\\%XXFilename%
                  set XXChtPath=%XXRootPath%\\CHT\\String_CncEngs\\%XXFilename%
                  set XXChsPath=%XXRootPath%\\CHS\\String_CncEngs\\%XXFilename%
                  "C:\Program Files\Notepad++\notepad++.exe" -nosession %XXEngPath% %XXChtPath% %XXChsPath%
                  endlocal
                  

                  While using a reg setting. This is tested and run on win10.

                  Registry file

                  setlocal
                  set XXNotePadPPPath="C:\Program Files\Notepad++\notepad++.exe"
                  
                  FOR %%i IN (%1) DO (
                  echo filedrive=%%~di
                  echo set filepath=%%~pi
                  echo filename=%%~ni
                  echo fileextension=%%~xi
                  
                  set XXFilePath=%%~di%%~pi
                  set XXFilename=%%~ni%%~xi
                  )
                  
                  set XXRootPath=%XXFilePath%..\\..
                  set XXEngPath=%XXRootPath%\\Common\\String_CncEngs\\%XXFilename%
                  set XXChtPath=%XXRootPath%\\CHT\\String_CncEngs\\%XXFilename%
                  set XXChsPath=%XXRootPath%\\CHS\\String_CncEngs\\%XXFilename%
                  %XXNotePadppPath% -nosession %XXEngPath% %XXChtPath% %XXChsPath%
                  endlocal
                  
                  1 Reply Last reply Reply Quote 3
                  • Alan Kilborn
                    Alan Kilborn last edited by

                    @Alan-Kilborn said in How to open specific files in different folder where root folder might be varied. Open File in Solution is my temporary solution.:

                    It sounds to me like a scripting plugin is needed to solve this problem.

                    Batch file scripting. The plugin-less scripting! :-)

                    1 Reply Last reply Reply Quote 3
                    • First post
                      Last post
                    Copyright © 2014 NodeBB Forums | Contributors