Community

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

    Execute the Current File in its ASSOCIATED Program

    Help wanted · · · – – – · · ·
    3
    5
    227
    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.
    • Dennis Bareis
      Dennis Bareis last edited by

      Is there a way to execute the current file (probably save it first if not) in the associated program or any program for that matter?

      It is not in the “Run” menu so maybe weird hotkey or plugin?

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @Dennis Bareis last edited by

        @dennis-bareis

        Run > Run… > cmd /c "$(FULL_CURRENT_PATH)"

        You can save that command by hitting the Save button in the dialog, give it a name and an optional keyboard shortcut of your choosing.

        The variable syntax for the Run menu is explained in the Configuration File

        Dennis Bareis 1 Reply Last reply Reply Quote 3
        • Dennis Bareis
          Dennis Bareis @PeterJones last edited by

          @peterjones said in Execute the Current File in its ASSOCIATED Program:

          cmd /c “$(FULL_CURRENT_PATH)”

          Thanks, that seems to work but that command would need more work (for a general solution) as a lot of commands will need the current directory to be set correctly.

          In any case, I found a better solution, there is a plugin called “RunMe” (not sure where the web page is but I used “Plugins Admin” to find and install it. The plugin takes care of the current directory also and has some other niceties.

          PeterJones 1 Reply Last reply Reply Quote 3
          • PeterJones
            PeterJones @Dennis Bareis last edited by

            @dennis-bareis said in Execute the Current File in its ASSOCIATED Program:

            Thanks, that seems to work but that command would need more work (for a general solution) as a lot of commands will need the current directory to be set correctly.

            That’s why the version I use is actually an NppExec script (save, cd, run) rather than a saved Run command.

            But glad you found something that works for you

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

              Hello, @dennis-bareis, @peterjones and All,

              Dennis, in order to open various text files with their default program ( Notepad for Windows OS ) you may also use the built-in N++ option File > Open in Default Viewer

              Once opened in N++, I could even opened a PDF file and an 7z archive by this means !

              • The PDF file correctly opened, in my Microsoft Edge software, thanks to its built-in PDF viewer function

              • The 7z archive correctly opened in my 7zFM Manager program

              However, the File > Open in Default Viewer option is greyed out if you try to open any picture ! Luckily, with the @peterjones method, it correctly opens the pictures in the default picture viewer : Photos !

              Best Regards,

              guy038

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