Need help Moving files and folders - Automated (not as easy as you would think)

  • Thread starter Thread starter walkerrob
  • Start date Start date
W

walkerrob

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!
 
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.
 
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.- Hide quoted text -

- Show quoted text -

Pegasus,
Thanks for such a quick reply. This is exactly what I was looking for.
I am sorry about the kneejerk comment, but have seen many posts with
quick responses that were of no help.

Thanks again for your assistance.

Regards,
Rob
 
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).

Either I'm mis-reading what your trying to do, or you could simply use
the above command, and then re-create the source folder. You could
even do it in a simple batch file.
 
Back
Top