I'm trying to backup all of my programs I've written without any of the other stuff, and their location in the folder structure is important because it helps me know what the program is for. Luckily I found this exact questions here already (Windows 7 - Move only files of a given extension while preserving folder structure), and the answer (Robocopy) works nearly perfectly. But unfortunately when I search for "*.sas" it includes all "*.sasb7dat" files, and while the .sas files are the plain text files I want, the .sasb7dat are data files (that are occasionally massive) that I very much do NOT want. Is there a way to restrict the search to only .sas files?
Asked
Active
Viewed 2,281 times
1
-
Possibly related: [Windows wildcards with files having more than 3 characters extensions](https://superuser.com/q/825615/354511) – G-Man Says 'Reinstate Monica' Jul 10 '17 at 01:51
-
Possibly related: [Exclude directories from Windows Search by wildcard](https://superuser.com/q/235799/354511) – G-Man Says 'Reinstate Monica' Jul 10 '17 at 01:51
-
Possibly related: [“dir *.cpp” wildcard matches “main.cpp_” and “main.cpp2”](https://superuser.com/q/971052/354511) – G-Man Says 'Reinstate Monica' Jul 10 '17 at 01:52
-
Possibly related: [dir command: 3 and 4 char extensions are the same?](https://superuser.com/q/238900/354511) – G-Man Says 'Reinstate Monica' Jul 10 '17 at 01:52
1 Answers
1
You would use the /XA:[RASHCNETO] or /XF switches to exclude files with specifics attributes.
- For example:
/XF *.sasb7dat- Also see
RoboCopy /?, SS64, TechNet Wiki, or TechNet
- Also see
One could also use the min/max exclusion switches.
- For example:
- Size:
/MAX:n - MAXimum file size - exclude files bigger than n bytes/MIN:n - MINimum file size - exclude files smaller than n bytes
- Age:
/MAXAGE:n - MAXimum file AGE - exclude files older than n days/date/MINAGE:n - MINimum file AGE - exclude files newer than n days/date
- Access:
/MAXLAD:n - MAXimum Last Access Date - exclude files unused since n/MINLAD:n - MINimum Last Access Date - exclude files used since n
- Size:
JW0914
- 7,052
- 7
- 27
- 48