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