silla
silla

Reputation: 1327

How to use 'dir' to different folders in one command?

Any ideas how to use the command 'dir' to more than 1 folder in one command?

dir c:\A | c:\test\B

is not working. Im not good with pipes...

Upvotes: 2

Views: 5182

Answers (2)

Robert Harvey
Robert Harvey

Reputation: 180878

Use the Get-ChildItem cmdlet instead, or use DIR and separate your sources by commas, not spaces. DIR doesn't work the same in PowerShell as it does in a DOS window.

http://technet.microsoft.com/en-us/library/ee176841.aspx

Upvotes: 3

Nick Hartung
Nick Hartung

Reputation: 418

dir c:\A c:\test\B should work. No pipe necessary.

Upvotes: 1

Related Questions