Community
    • Login

    Open all files in Directory

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

                @Mark-Olson Thanx, good point.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors