Open all files in Directory
-
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. -
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!
-
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)
-
@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 -
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 -
@Mark-Olson Thanx, good point.
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