• Login
Community
  • Login

Open all files in Directory

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 4 Posters 298 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.
  • R
    Robert Or Janet Diebel
    last edited by Jan 16, 2025, 3:17 PM

    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.

    P 1 Reply Last reply Jan 16, 2025, 3:54 PM Reply Quote 0
    • L
      litos81
      last edited by Jan 16, 2025, 3:54 PM

      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
      • P
        PeterJones @Robert Or Janet Diebel
        last edited by PeterJones Jan 16, 2025, 3:55 PM Jan 16, 2025, 3:54 PM

        @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)

        R 1 Reply Last reply Jan 16, 2025, 4:41 PM Reply Quote 0
        • R
          Robert Or Janet Diebel @PeterJones
          last edited by Jan 16, 2025, 4:41 PM

          @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
          
          
          M 1 Reply Last reply Jan 16, 2025, 4:47 PM Reply Quote 1
          • M
            Mark Olson @Robert Or Janet Diebel
            last edited by Jan 16, 2025, 4:47 PM

            @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

            R 1 Reply Last reply Jan 16, 2025, 5:03 PM Reply Quote 0
            • R
              Robert Or Janet Diebel @Mark Olson
              last edited by Jan 16, 2025, 5:03 PM

              @Mark-Olson Thanx, good point.

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