P
PhilHibbs
I'm trying to sync one directory with another. I've got an xcopy
command that makes sure that files on the source are present on the
target, but I also want to delete files on the target that are not
present on the source.
Currently my command looks like this:
for /R Z:\test1 %F in (*.*) do if not exist "X:%~pnxF" del "%F"
This works fine when I run it on the command prompt directly, but
doesn't work in a cmd file. I seem to remember something about having
to double up the % but I can't remember the details, I tried this in
various places but can't make it work. Any ideas?
Phil Hibbs.
command that makes sure that files on the source are present on the
target, but I also want to delete files on the target that are not
present on the source.
Currently my command looks like this:
for /R Z:\test1 %F in (*.*) do if not exist "X:%~pnxF" del "%F"
This works fine when I run it on the command prompt directly, but
doesn't work in a cmd file. I seem to remember something about having
to double up the % but I can't remember the details, I tried this in
various places but can't make it work. Any ideas?
Phil Hibbs.