1.

Solve : moving dir and sub dir to a different dir?

Answer»

How can I move an entire directory structure to another using a BATCHFILE, lets SAY i wanted all directories, sub directories and files from c:\fold1 to be moved to c:\fold2 ..First copy, after delete:

XCOPY c:\fold1\* c:\fold2 /e /h /q /v
rd c:\fold1\* /s /q <-- beware !

P.S. for more information:
xcopy /?
rd /?

(the next don't move hidden files, and only works on W2000 and laters)
[size=16]OR[/size]

Move first files, after directories:

for %%x in (c:\fold1\*) do move %%x c:\fold2
for /d %%x in (c:\fold1\*) do move %%x c:\fold2

[size=16]OR[/size]

for /F %%x in ('dir /B c:\fold1') do move c:\fold1\%%x c:\fold2\



Discussion

No Comment Found