Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to move 450,000+ files

Status
Not open for further replies.

ccoyle

MIS
Jan 30, 2003
17
US
Hi All,
I have a 450,000+ row Excel doc listing files from different directories that I need to move to a new location and maintian directory structure.

Examples:
'N:\HR\Policies\evacuation.xls' needs to be moved to 'N:\Archive\HR\Policies\evacuation.xls' (Destination does not exist)
'N:\Accounts\Tech\HP\agreement.doc' needs to be moved to 'N:\Archive\Accounts\Tech\HP\agreement.doc' (Destination does not exist)

I was thinking to convert the data to a .txt and use VB to read the data, create the dest directory and move the files one line at a time. Miggy recommended I post in this forum to see if someone might have a VBA solution to this task? Any assistance would be greatly appreciated!

Thanks!

Cheers,
-Chris
 
Check out Name As in VBA Help

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
It seems to me that all that is required here is to create the 'Archive' folder, then drag the 'HR', 'Accounts', etc folders into it. There is no need to move 450,000 individual files.

Cheers
Paul Edstein
[MS MVP - Word]
 
I need to move [files] to a new location and maintian directory structure.

macropod, what you suggest would move the directory structure (to Archive folder) as well. :-(

Have fun.

---- Andy
 
If I understand correctly, you want to copy the directory structure and move the files?
i.e. what is left will be an Archive folder containing all files in their respective tree and a now empty directory tree outside the archive?

Maybe saving as txt is not a bad step after all - just don't use VB to perform the operations but use Notepad++ to alter your text file into a robocopy batch file!
e.g.
Replace 'N:\HR
with
Robocopy -mov 'N:\HR

After that, replace tab with space.
You should end up with lines that look like this:
Robocopy -mov 'N:\HR\Policies\evacuation.xls' 'N:\Archive\HR\Policies\evacuation.xls'

You might need to replace single quotes with double quotes, not sure.
The robocopy "-mov" switch (not -move !!!!) moves the files but leaves the folders, if I'm not mistaken.
That should accomplish just what you need.
:)

Cheers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
Ooooo - that sounds like it might be my best solution to date, Captain - thanks!
I was looking into Robocopy but hadn't gotten too deep with it - I will try your recommendation and report back, Sir! :)

FYI - I'm not copying everything into the archive. There are hundreds of directories/sub directories containing both data I'm moving and data I'm not moving. Originally, I generated the list with a VB script that reported on modified date, but the "powers that be" messed with the output just enough so I can't use that same criteria to archive based on modified.


Thanks All!
-Chris

 
I need to move [files] to a new location and maintian directory structure.
macropod, what you suggest would move the directory structure (to Archive folder) as well.
On my reading of the examples given, that is the intent.

Cheers
Paul Edstein
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top