I am using the following script. When I swap out the "move" with "robocopy /mov /mt" it doesn't work. The destination goes one level too deep and takes the name of the file as the destination folder. Error is below too.
How can I use robocopy instead? I need the multithreading.
Error= ERROR 123 (0x0000007B) Accessing Source Directory D:\source\FILE.tif\ The filename, directory name, or volume label syntax is incorrect.
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
SET Source=D:\source
SET Destination=D:\dest
Echo Gather Top 30 files
set SrcCount=0
set SrcMax=31
FOR /F "TOKENS=*" %%a IN ('dir /A-D /O-D /B "%Source%"\*.*') DO (
SET /A SrcCount += 1
if !SrcCount! LEQ %SrcMax% (
MOVE "%source%\%%a" "%destination%
)
)
This is what I am trying:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
SET Source=D:\source
SET Destination=D:\dest
Echo Gather Top 30 files
set SrcCount=0
set SrcMax=31
FOR /F "TOKENS=*" %%a IN ('dir /A-D /O-D /B "%Source%"\*.*') DO (
SET /A SrcCount += 1
if !SrcCount! LEQ %SrcMax% (
robocopy /mov /mt "%source%\%%a" "%destination%
)
)
robocopy /?and read the help; you will find that there is a different syntax, concerning source and destination, both are considered as directories; you should not guess the syntax... - aschipfl