|i can't write winXP batch script because my XP system is dead, but this might be the logic structure:|
'path1 is the path you are using as the standard
'path2 is the one you want to "clean up"
for x in (dir /b /a:d) do
for y in (dir /b *.*) do
if not(exist) p1+"\"+y
'much apologies, i KNEW that was too simple!
'the path-string manipulation much more gnarley:
'this is the gnarly part i didn't count on...
'base dir. of C for example: C:\uuu\bbb
'base dir of F (whatever, network drv) is: F:\y\z
'whatever locn of F, need to snip off "F:\y\z"
'from curr. locn ("CD") and repl
'with "C:\uuu\bbb" base path to test 'for 'existance.
'via a "dir /a:d /b" command or "if exist" test.
'get curr. fullpath on slave: can you do this?
'snip off the base
'is there such a thing as len()?
'is such thing as mid (or substr, etc)
'now stick it onto the master basepath
'you can see why i am currently limited,
'but others in forum will know how to do
'this snip/cut/paste stuff.
if not (exist) p1+"\"+x
i'm not sure if this would work, i don't have the equipment
to try it or the syntax knowledge to write it. the idea is
that "foo" keeps calling itself until it reaches the periphery
of the tree structure, then starts conditionally deleteing
all the files not on drive C of the same name and path.
the "rd" (rmdir, remove directory) is not conditional cause
i couldn't think of a quick and easy way to see if it is empty,
but if it's not empty, the "rd" will fail anyway, so no harm done. my logic might be horse-dukey, so if you manage
to translate it into working code, be careful about testing.
ps: my mistake, forgot to put the path-strings
in the code. (p1, pn)