Community
    • Login

    Open a file with npp exec

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 1.2k Views 2 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.
    • Patrick DanileviciP Offline
      Patrick Danilevici
      last edited by

      I use NPP EXEC plugin to compile with arara my LaTeX file. All is ok. The final command I want to open the specific file that is created. How to open a file using npp exec command?

      I tried

      cmd $(CURRENT_DIRECTORY)\$(NAME_PART).pdf 
      

      but I get

      Process started (PID=11388) >>>
      Microsoft Windows [Version 10.0.19042.804]
      (c) 2020 Microsoft Corporation. All rights reserved.
      X:\full-path\>
      

      and is waiting for my input.

      Alan KilbornA 1 Reply Last reply Reply Quote 1
      • Alan KilbornA Offline
        Alan Kilborn @Patrick Danilevici
        last edited by Alan Kilborn

        @Patrick-Danilevici

        Maybe try start instead of cmd.
        Or perhaps cmd /c start.

        1 Reply Last reply Reply Quote 0
        • Alan KilbornA Offline
          Alan Kilborn
          last edited by

          Actually I missed the part about NppExec which I’m not the most familiar with. Maybe it has better ways…

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • PeterJonesP Offline
            PeterJones @Alan Kilborn
            last edited by

            @Patrick-Danilevici ,

            even from the normal command line, if you typed cmd.exe blah.pdf, you would get the same result. (Try it, I did)

            The correct syntax to run a command (or a file) with cmd.exe is cmd /c filename. Thus, if you run

            cmd /c "$(CURRENT_DIRECTORY)\$(NAME_PART).pdf"
            

            it will launch your file association for PDF files with the special variables to define the file’s path. (Note: I also added the quotes, because $(CURRENT_DIRECTORY) can contain spaces

            Patrick DanileviciP 1 Reply Last reply Reply Quote 3
            • Patrick DanileviciP Offline
              Patrick Danilevici @PeterJones
              last edited by

              @PeterJones Teaching literature is not an advantage when you use pc that’s why sometimes I ask on communities simple questions. Is working now. Thanks a lot!

              1 Reply Last reply Reply Quote 0

              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