We help IT Professionals succeed at work.
Get Started

xxcopy batch file to move specific client folders using an input text file.

3,498 Views
Last Modified: 2017-02-10
I am in the testing phase right now, so I am using local test source folders.  The F:\xxcopy\NAS\FROM\ folder has (A,B,C,D,E - Z) subfolders, and within each letter folder there are specific client folders that will be listed in an input file:  ClientFolders.txt.

Sample ClientFolders.txt
F:\xxcopy\NAS\FROM\I\INYONG*
F:\xxcopy\NAS\FROM\1-9\724REA*

The problem with the client folders is the name is composed of the client ID (i.e. INYONG, 724REA) which should be the first six characters of the folder name.  After the folder name sixth character there is additional client descriptive text.  So that is why I appended the "*" afterwards.  The first six characters of the folder (Client ID) will always be unique.

I simply want the batch file to use the input text file that has the first six characters of folder names that need to be located and moved.  

So I created the following batch file using xxcopy:

text-copy.bat

for /f "delims=" %%i in (ClientFolders.txt) do echo D|xxcopy "F:\xxcopy\NAS\FROM\%%i" "F:\xxcopy\NAS\TO\%%i" /SC /F /S /E /VL /YY /V /JV /RC /TTA0 /TCA /H /TCC /TCW /I /FW /oA:"F:\xxcopy\29MAR2016 TEST Folder\Logs\Test1.log" /oF3

The above log file reveals the following errors: Exit code 34 (illegal command parameter.  Invalid destination directory name.

===============================================================================
XXCOPY   Pro Edition   ver 3.21.1   2016-03-29 18:44:40   Windows Ver 5.2.3790 Service Pack 2
 Command Line  = xxcopy "F:\xxcopy\NAS\FROM\F:\xxcopy\NAS\FROM\I\INYONG*" "F:\xxcopy\NAS\TO\F:\xxcopy\NAS\FROM\I\INYONG*" /SC /F /LTREE /VL /YY /V /JV /RC /TTA0 /TCA /H /TCC /TCW /I /FW /oA:"F:\xxcopy\29MAR2016 TEST Folder\Logs\Test1.log" /oF3
Invalid destination directory name

 Directories Processed = 0
 Total Data in Bytes   = 0
 Elapsed time in sec.  = 0.000
 Action speed (MB/min) = 0.0
 Files Selected        = 0
 Log File Appended     = "F:\xxcopy\29MAR2016 TEST Folder\Logs\Test1.log"
 Exit code             = 34 (Illegal command parameter)


===============================================================================
XXCOPY   Pro Edition   ver 3.21.1   2016-03-29 18:44:40   Windows Ver 5.2.3790 Service Pack 2
 Command Line  = xxcopy "F:\xxcopy\NAS\FROM\F:\xxcopy\NAS\FROM\1-9\724REA*" "F:\xxcopy\NAS\TO\F:\xxcopy\NAS\FROM\1-9\724REA*" /SC /F /LTREE /VL /YY /V /JV /RC /TTA0 /TCA /H /TCC /TCW /I /FW /oA:"F:\xxcopy\29MAR2016 TEST Folder\Logs\Test1.log" /oF3
Invalid destination directory name

 Directories Processed = 0
 Total Data in Bytes   = 0
 Elapsed time in sec.  = 0.000
 Action speed (MB/min) = 0.0
 Files Selected        = 0
 Log File Appended     = "F:\xxcopy\29MAR2016 TEST Folder\Logs\Test1.log"
 Exit code             = 34 (Illegal command parameter)
Comment
Watch Question
End-user support
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 21 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE