How to display only files that have alternate data streams in Command Prompt
Asked Answered
O

1

17

I know that to display alternate data streams of all the files (if any) in command prompt, this is the command dir /R. But, how do I do it if I only want to display files that have alternate data streams?

Ocam answered 2/5, 2013 at 8:45 Comment(5)
Put it in a for loop batch.Juline
what do you mean by put in for loop? because dir /R displays all files, regardless of them having ADS or not. I'm asking if there is a way to only show the files that have ADS, if possible, output them to a text file.Ocam
Can you use "streams" from Microsoft Sysexternals?Juline
erm i need the command in command prompt, can't use any other programs :/Ocam
"Streams" is a command line tool, for use on the command prompt.Juline
B
22
dir   /s /r | findstr /e ":$DATA"

or

dir   /r | findstr /e ":$DATA"

the first will search in all sub-directories.The second only in current folder. These will show also the ADS assigned to the directory.For only files:

dir /a-d  /s /r | findstr /e ":$DATA"
Bookerbookie answered 27/5, 2013 at 22:19 Comment(2)
What if the alternate stream is named something other than ":$DATA"? What about ":HIDDEN" or ":MALWARE", etc.?Tananarive
@JimJRHarris - try this: (echo #>:ads) && (dir /r /s) - all alternate data streams end with $DATA when dir command is used.Bookerbookie

© 2022 - 2024 — McMap. All rights reserved.