ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Is robocopy faster than Windows GUI to "Move" files between drives

(1/2) > >>

questorfla:
The problem may even be in the manner in which i coded for it.  I had originally thought it to be a lot faster and for small folders this setup worked pretty well but when i tried it on an entire "Downloads" folder with several thousand files, it seemed to bog down.  It also seemed to ignored Ctrl+C to get it to exit for some reason.  If anyone could suggest modifications to allow it to be exited while running as well as restarted without an error (due to the mkdir command not being needed)


--- Code: Text [email protected] offclsset /P  from="Enter Move from Path:  "set /P to="Enter Move To path:  "mkdir %to%FOR    %%i IN ("%from%"\*) DO           MOVE /Y "%%i" "%to%\%%~nxi"FOR /D %%i IN ("%from%") DO ROBOCOPY /MOVE /E "%%i" "%to%\%%~nxi"exit
Or maybe a completely different method.  Windows GUI works fine if it didn't have to do the "calculating" test run before it ever starts at all :(

4wd:
You can set Robocopy to use multiple threads, (Win7+ ; by default it is 8), having said that, most likely the problem will be that all the operations are being performed on the same source and destination concurrently which probably leads to a bit of head thrashing on a HDD.

You could try reducing the number of threads Robocopy uses with the /MT:x parameter, (x is the number of threads required between 1 and 128).

Possibly start at /MT:2 and increase by one until you see performance drop off.

mkdir isn't needed for Robocopy, it'll create folders as it goes and it should skip any files that have already been copied (options permitting) according to the table here.

BTW, if you're going to use Robocopy where there's any chance that the files will already be opened then it will fail on those files, (it won't access open files).  You can get around that by either using:
1) ShadowSpawn (which is a replacement for Hobocopy below) which will create a VSS copy before running Robocopy, or;
2) Hobocopy which was a less featured version of Robocopy that could use the VSS, (written by the author of ShadowSpawn).

Shades:
I believe you can disable the "Calculating size" bit in Directory Opus.

From your code I understand that you want to move stuff from every subfolder in the %from% folder into one giant pile in the %to% folder.

A word to the wise:
The NT-filesystem doesn't like folders with huge amounts of files in them. If you have such a folder, you will notice that Windows will slow down to a crawl...at least until it is finished processing the folder.  Doesn't matter how much "horse-power" your PC has, opening and/or working with a folder that contains several thousands of files, performance degrades significantly. And yes, I know that in theory the NT-file system supports loads and loads of files in whatever structure you can think of. In practice: better keep an eye on the amount of files you store in a folder.
  
I would try something like this:


--- [email protected] OFF
CLS

::User settings
SET /P srcfolder="      Enter source path:  "
SET /P dstfolder="Enter destination path:  "
    
::Folder check
IF NOT EXIST "%srcfolder%" GOTO :ENDFAIL
IF NOT EXIST "%dstfolder%" MKDIR "%dstfolder%"

::Logic
PUSHD "%srcfolder%
FOR /r %%a IN (*.*) DO (
  MOVE "%%a" "%dstfolder%\%%~nxa"
  )
POPD
GOTO :ENDOK
    
:ENDFAIL
ECHO Folder error: %srcfolder%
EXIT
:ENDOK
EXIT

mwb1100:
Maybe there's something I don't understand: why are you using the "move" command then using "robocopy /move"?

Robocopy works on directories by default, so instead of using the batch "for" command I think you can do what you want with a single robocopy command:

    robocopy /move /e "%from%" "%to%"

Also, I have heard good things about tools like teracopy, but I don't use such a program myself (I do use XYplorer, which works well enough for my needs).

4wd:
Also, w.r.t. Robocopy, if you look at the options (robocopy /?) under /MT (if you want to play with multi-threading):

---------------------------------
/MT[:n] :: Do multi-threaded copies with n threads (default 8).
               n must be at least 1 and not greater than 128.
               This option is incompatible with the /IPG and /EFSRAW options.
               Redirect output using /LOG option for better performance.
---------------------------------

ie. Don't have it writing to the console.

Navigation

[0] Message Index

[#] Next page

Go to full version