Select all files with particular attribute set ?

  • Thread starter Thread starter MoiMeme
  • Start date Start date
M

MoiMeme

Hi,

happy new year all

Simple question perhaps :
- how can I select all files with a given attribute set ( for example all
system files) within a folder and subfolders ?

TIA !!
 
MoiMeme said:
Hi,

happy new year all

Simple question perhaps :
- how can I select all files with a given attribute set ( for example all
system files) within a folder and subfolders ?

TIA !!

Please describe exactly what you want to do.

Are you looking for a list of files in a given subtree which have the
attribute(s) set or do you want some variety of graphical methodology?

If you simply want a list, what are you going to do with the list? Simple
text list for a report, EXCEL (.CSV) list for some purpose, or are you going
to perhaps use the list to make an archive?

More info - better help.

HTH

....Bill
 
I want to be able to select all files with attributes read-only & system
set, build a list of them and backup to an archive.
The Windows search module doesn't allow tro select according to attribute(s)
( or at least I haven't been able to find how)
 
MoiMeme said:
Hi,

happy new year all

Simple question perhaps :
- how can I select all files with a given attribute set ( for example all
system files) within a folder and subfolders ?

TIA !!

Perhaps:
Command Prompt
Dir /?

will be what you need.

You can export the result to a text file as: DIR {switch selections} >
{path}\{file name}.txt

Don
 
By searching then clicking attributes column - all the A will be next to each other, all the AR, so you'll have only limited click - shift click to do.
 
MoiMeme said:
I want to be able to select all files with attributes read-only & system
set, build a list of them and backup to an archive.
The Windows search module doesn't allow tro select according to
attribute(s) ( or at least I haven't been able to find how)

Here's a batch job that may help.

It's still not crystal clear whether you want (all files with attributes
(read-only & system set)) or (all files with attribute read-only) & (all
files with attribute system set)) but minor changes can easily be
accommodated.

[1]@echo off
[2]if exist arclist.txt del arclist.txt
[3]for /f "delims=" %%i in ('dir /b/a-d/s') do echo %%~ai %%~fi
[4]for /f "delims=" %%i in ('dir /b/a-d/s "d:\pathname\filemask.ext" ') do
echo %%~ai|findstr /r "r..s" >nul&if not errorlevel 1 echo %%~fi
Each line begins [number]. Lines will be wrapped in transmission and need to
be rejoined. The [number] at the beginning of each line needs to be removed.


notes:
line [3] is redundant; it's there to show what is produced by the ~a
modifier facility to the FOR command. Note that it produces the string
"-rahs----" with any not-set attribute replaced by "-"

on line [4], the FINDSTR command is looking for "r..s" (r and s separated by
any 2 characters) if you want EITHER r or s set, then use "r s" in place of
"r..s"

arclist.txt will be built with the full filenames of the files to be
archived.

HTH

....Bill
 
Back
Top