pm_li
pm_li

Reputation: 43

CMD dir command

I'm using dir to retrive all directories from specified path but I'm getting directories paths from two locations.

dir "C:\ssis" /b /s /ad *.* | sort >c:\ssis\task4\content.txt

And result is

enter image description here

I want to get only marked (yellow) lines. Not directories from place where I open CMD

Thanks :) PM

Upvotes: 0

Views: 473

Answers (1)

Jens
Jens

Reputation: 69505

remove *.*:

dir "C:\ssis" /b /s /ad | sort >c:\ssis\task4\content.txt

Because you specify the directory where you want to list the files earlier "C:\ssis" so *.* will also list files in actual directory.

Upvotes: 2

Related Questions