Community
    • Login

    Open all files in Directory

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 4 Posters 1.0k 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.
    • Robert Or Janet DiebelR Offline
      Robert Or Janet Diebel
      last edited by

      get-childitem *.txt |foreach-object {
      >>     Notepad++.exe $_.name
      >> }
      

      Using Powershell, this will not find or recognize Notepad++
      How do I make this work?
      It is eazy from Explorer, but it sorts wrong for my purpose.
      Powershell & Cmd sort as I want.
      I could also use CMD if someone could help with that.
      Or could I change the sort function in explorer?
      All help much appreciated.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • L Offline
        litos81
        last edited by

        Hello @Robert-Or-Janet-Diebel ,

        you may add the full path to notepad++:

        get-childitem *.txt |foreach-object {
        >> & "C:\full\path\to\notepad++.exe" $_.name
        >> }
        

        Hope it helps!

        1 Reply Last reply Reply Quote 3
        • PeterJonesP Offline
          PeterJones @Robert Or Janet Diebel
          last edited by PeterJones

          @Robert-Or-Janet-Diebel .

          Either you need to add the directory where notepad++.exe is to your PATH, or you need to include the full path to notepad++.exe in your powershell command (as @litos81 posted just as I was typing)

          Robert Or Janet DiebelR 1 Reply Last reply Reply Quote 0
          • Robert Or Janet DiebelR Offline
            Robert Or Janet Diebel @PeterJones
            last edited by

            @PeterJones
            What worked for me:

            PS E:\documents\Zambia\LuvaleText> get-childitem *.txt |foreach-object {
            >>     Start notepad++ $_.name
            >> }
            PS E:\documents\Zambia\LuvaleText>
            
            Also, I did get the full path into the path variable.
            Thanx to all.
            Bob
            
            
            Mark OlsonM 1 Reply Last reply Reply Quote 1
            • Mark OlsonM Offline
              Mark Olson @Robert Or Janet Diebel
              last edited by

              @Robert-Or-Janet-Diebel

              Glad you figured it out! By the way, going forward you should probably obfuscate any directory paths that you post online, e.g., replacing the true path to a file with C:\path\to\blah.txt

              Robert Or Janet DiebelR 1 Reply Last reply Reply Quote 0
              • Robert Or Janet DiebelR Offline
                Robert Or Janet Diebel @Mark Olson
                last edited by

                @Mark-Olson Thanx, good point.

                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