|So this is basically what I'm trying to do, |
remove the string stored in %DST% from the
If it is not possible to do this, then let me
explain why I'm trying to, and maybe it can be
approached from a different angle...
I need to compare all the files in a destination
directory (and subdirectories) with those of a
source directory. If a file in the destination
does not exist in the source, delete it. Within
their respective root directories (%SRC% and
%DST%), the directory structures are
identical. I would like to keep the source and
destination root directories as variables so any
necessary changes will only have to be made
in one place in the file.
This is what I currently have. It works only if I
type the literal DST string in the following:
I appreciate any help!
For /f "delims=" %%a in ('Dir /s /b %DST%')
if not exist "!SRC!\!relname!" (
rmdir "!DST!\!relname!" /s /q
del "!DST!\!relname!" /q