Example 1 shows how to delete specific files by name.
This uses the ability to specify wildcards in the file names. Assume you don't
want to copy any temp files or log files:Example 1
C:\ E:\ subdirs exclude ~*.*
*.tmp *.log
After the word 'exclude', you can list multiple file
names. In Example 1 above, the files will only be excluded if they exist in the
source directory C:\.
|
If you want to exclude these files regardless of where
they are located, you need to add 'subdirs' after the list of files to exclude:Example 2
C:\ E:\ subdirs exclude ~*.*
*.tmp *.log subdirs
In Example 2, the files will be excluded by JCOPY if they
exist in any sub-directory of C:\.
|
There is a third variation of this line, which only has 'subdirs'
listed after 'exclude':Example 3
C:\ E:\ exclude ~*.* *.tmp
*.log subdirs
But this gives exactly the same results as the same line
without 'subdirs':
C:\ E:\ exclude ~*.*
*.tmp *.log
The 'subdirs' has no effect in Example 3. The reason is that
only the files in C:\ are copied. No subdirectories beneath C:\ are copied, so
the 'subdirs' has no effect.
|
Assume that you want to skip folders as well as files. You identify the
folders by having a backslash in front of the name:Example
4
C:\ E:\ subdirs exclude ~*.* *.tmp
*.log \temp \tmp subdirs
In Example 4, these files (~*.* *.tmp
*.log) and folders (\temp \tmp) will be excluded by JCOPY if they
exist in any sub-directory of C:\.
|
Here is a variation of Example 4, which uses long file names. You must put
double quotes at the start and end of any "long name" file or folder:Example
5
C:\ E:\ subdirs exclude "A
long file name" ~*.* *.tmp
*.log \temp \tmp "\temporary internet files" subdirs
|