Re: Need help Moving files and folders - Automated (not as easy as you would think)
- From: "Pegasus \(MVP\)" <I.can@xxxxxxx>
- Date: Fri, 17 Aug 2007 23:19:48 +0200
<walkerrob@xxxxxxxxx> wrote in message
news:1187384003.457861.5890@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Please test for yourself before giving a kneejerk response:
I want to move the contents of a source (i.e. c:\temp\Data1\*.*) to
the destination (i.e. c:\temp\Data2\*.*).
I want to leave the source directory structure in tact while basically
moving all contents of the Data1 directory to Data2 (Files and
Folders).
I have tried every copy tool under the sun that I could find and
always get about 90% there. At the end of the day I would like to use
Robocopy but when I use the command
Robocopy C:\Temp\Data1 C:\Temp\Data2 /MOVE
The source directory is intact which is desired, but the Folders in
the source directory are still there. I want the source folders in
Data1 to be moved to Data2 (the source folder names change constantly
so I won't be able to specify individual folders by name).
Or
Robocopy C:\Temp\Data1 C:\Temp\Data2 /MOVE /MIR
The source directory Data1 is deleted which is not a required result.
I want the Data1 directory to stay intact. The good news is all the
files AND folders are moved. I know I can add a command to create the
directory again once it has been deleted, but I need that directory to
never be deleted. If it is deleted it caused the program dumping the
files to the source to blow up.
Another fault I see with the /MIR it mirrors the source to the
destination so when it runs a second time the destination folder is
completely wiped out with the new source files. I want the source
files to move into (merge) the destination directory and keep the
previous destination files intact as well.
I have tested numerous other freeware apps but they must have Robocopy
built into them because I seem to get the same results when using
them.
If there is anyone out there that can offer advice or alternative
tested results that would be greatly appreciated.
Thanks in advance for your help!
Here is my kneejerk response in the form of a batch file:
@echo off
cd /d c:\temp\Data1
if not exist c:\temp\Data2 md c:\temp\Data2
move *.* \temp\Data2
for /d %%a in (*.*) do move "%%a" \temp\Data2
Note that the batch file will fail if some file or folder
from Data1 already exists in Data2. Additional code
would be required to deal with this case.
.
- Follow-Ups:
- References:
- Prev by Date: Need help Moving files and folders - Automated (not as easy as you would think)
- Next by Date: Re: Local System account and network resource access
- Previous by thread: Need help Moving files and folders - Automated (not as easy as you would think)
- Next by thread: Re: Need help Moving files and folders - Automated (not as easy as you would think)
- Index(es):
Relevant Pages
|
Loading