Move command - folder structure creation

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
oruganti99
Posts: 2
Joined: 27 May 2014 05:29

Move command - folder structure creation

#1 Post by oruganti99 » 27 May 2014 05:40

Hi All,

how can i move the folders from one file server to other.

Below is my code and I've around 15000 files from various folders to move.
************************************************************************

Code: Select all

move "Z:\Archive & Old\NTD.mdb" "\\FileServer01\dept\IT\Archive\NTD.mdb
if not %errorlevel%==0 echo Failed to move:(Test) NTD.mdb >>"\\FileServer01\data\IT\MSAccErrorLog.txt"

************************************************************************
Above code is working only if the destination has respective folder.
Is there anyway which can creates the folder structure like it does in xcopy command.

TIA.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Move command - folder structure creation

#2 Post by foxidrive » 27 May 2014 05:54

That's not going to move 15000 files though. :)

What is your real task, because you can just add a MD command before that code or use Robocopy.

Squashman
Expert
Posts: 4470
Joined: 23 Dec 2011 13:59

Re: Move command - folder structure creation

#3 Post by Squashman » 27 May 2014 06:31

oruganti99 wrote:Is there anyway which can creates the folder structure like it does in xcopy command.

Look at Robocopy.

oruganti99
Posts: 2
Joined: 27 May 2014 05:29

Re: Move command - folder structure creation

#4 Post by oruganti99 » 27 May 2014 10:22

Hi All,

thank you so much for all your quick replies.
Im on Win XP and i believe it wont support Robocopy.
My main aim is to move mdb files from one loc to other, hence im creating a batch to process the task by creating same folder structure.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Move command - folder structure creation

#5 Post by foxidrive » 27 May 2014 10:48

You can download a version of Robocopy for XP from Microsoft.

Post Reply