Sie sind auf Seite 1von 138

TOC

COPY BIG FILES


15 Free File Copy Tools Tested for the Fastest Transfer Speeds
10 best free fast File Copy software for Windows 10 PC
How to use RoboCopy on Windows 10
Robocopy: Better, Faster, Stronger - Stephen Foskett, Pack Rat
How to use Robocopy to transfer files super-fast over the network on Windows 10 •
Pureinfotech

DELETE BIG FILES


How to delete all files in a directory with RoboCopy
How to Clean Folder Contents when a Filename or File Path is to long
How to delete large folders in Windows super fast
Mass deleting files in Windows
How to Speed Up Folder Deletion Times by 20x or More!
Rapid Delete Pro
Fast Delete Complex Directories
Using Batch Files
4 Free Ways to Quick High-level Format SD/USB/Hard Drive – EaseUS
A vy neznáte ROBOCOPY?

PRESERVE ORIGINAL ATTRIBUTES


How to Copy Files without Changing Date Stamp on Windows 10
How to preserve original attributes
How to preserve file attributes
Copy a Folder to Another Folder and Retain its Permissions
FreeFileSync

BACKUP OR RESTORE FILE/FOLDER ATTRIBUTES


Save and Restore NTFS permissions using ICACLS
How to Backup and Restore NTFS Permissions Using ICACLS
Warning

ROBOCOPY
Pause robocopy
Taming Robocopy - The Silicon Underground
How to pause Robocopy.exe
Robocopy Complete Reference
Syncing
Robocopy script to synchronize folders
Warning
Uh Oh! Robocopy gone wrong
ROBOCOPY /MIR not working like I think it should.
Others
Robocopy: Best practices for working with this helpful Windows utility
Copying files with long names robocopy. Where are my files, ROBOCOPY

Warning
AD properties>Security tab>advanced>Owner tab, make sure they are the owner of there
own object properties.
Permissions tab>click change permissions>remove the (not inherited) permissions from the
sub folder>check mark include inheritable permissions from objects parent> click apply>
check mark replace all child permissions with inheritable permissions from this object> click
apply> click OK

How to Backup and Restore NTFS Permissions Using ICACLS


Managing NTFS permissions on file server folders may be quite tiresome. Inaccurate changes to
the top (root) level of the directory may lead to unexpected results when individual permissions
on lower-level files and directories are forcefully changed. Prior to significant change of
permissions (moving, ACL update, resource migration) on an NTFS folder (Shared Folder), it is
recommended to back up earlier permissions that will allow you to return to the original settings
or at least see the previous access permissions to the specific file or folder.

To export/import current NTFS directory permissions, you can use built in utility icacls. This tool
enables to get and change access control lists (ACLs) of file system objects.
To get all ACLs for a specific folder including its subfolders and files and save them as plain text,
run the following command:

icacls g:\veteran /save veteran_ntfs_perms.txt /t /c


The file containing access permissions is saved by default to the current user folder.
Note. /t key is used to get ACLs for all subdirectories and files, /c allows to ignore access
errors. By adding /q key, you can disable the display of information about successful access to
the file system objects.
Depending on the number of files and folders, the export of permissions can take quite a long
time. After the command has been executed, the statistics on the number of successful or failed
processing of files will be displayed.

Successfully processed 3001 files; Failed processing 0 files

Open the file veteran_ntfs_perms.txt using any text editor. As you can see, it contains the full list
of files and folders in a directory, and each item has the current permissions specified
in SDDL (Security Descriptor Definition Language) format.

For example, the current NTFS permissions for the root directory are as follows:

D:PAI(A;OICI;FA;;;BA)(A;OICIIO;FA;;;CO)(A;OICI;0x1200a9;;;S-1-5-21-2340243621-
32346796122-2349433313-23777994)(A;OICI;0x1301bf;;;S-1-5-21-2340243621-32346796122-
2349433313-23777993)(A;OICI;FA;;;SY)(A;OICI;FA;;;S-1-5-21-2340243621-32346796122-
2349433313-24109193)S:AI
This string describes the access for some groups or users. We won’t consider SDDL syntax in
detail (if necessary, you can find help on MSDN). Let’s dwell on a small extract of SDDL by
choosing only one object:

(A;OICI;FA;;;S-1-5-21-2340243621-32346796122-2349433313-24109193)
A – access type (Allow)
OICI – inherit flag (OBJECT INHERIT+ CONTAINER INHERIT)
FA – permission type (SDDL_FILE_ALL – all allowed)
S-1-5-21-2340243621-32346796122-2349433313-24109193 – SID of the account or
domain group that has these permissions. To convert SID to the account or group name, use the
following command:
$objSID = New-Object System.Security.Principal.SecurityIdentifier ("S-1-5-21-
2340243621-32346796122-2349433313-24109193")
$objUser = $objSID.Translate( [System.Security.Principal.NTAccount])
$objUser.Value

Or use one of the commands:


Get-ADUser -Identity SID
or
Get-ADGroup -Identity SID
Thus, you have found that the user corp\dtrump had Full Control permissions on this directory.

To restore NTFS permissions on the objects of this folder automatically according to the values
from the backup file, run this command:

icacls g:\ /restore veteran_ntfs_perms.txt /t /c


Note. Please, note that when importing permissions from the file, you should specify the path to
the parent directory instead of the folder name.
After all permissions have been recovered, the statistics on the number of the processed files will
also be displayed.

Save and Restore NTFS permissions using ICACLS


So you need to make a big NTFS rights change. Well before changing anything do you have a
good backup of the old permissions?
Most people will say I got a backup. But restoring the backup will take much longer than
restoring just the permissions.

So how do I make a backup of the NTFS permissions?


icacls c:\windows\ /save AclFile /T /C /Q

So lets break this command up

icacls = command to run


C:\windows\ = directory/file to run the command on
/save = command to excute
AclFile = where to save the ACLs
/T = Recurse the directory
/C = Continue even after a single failure
/Q = Dont print information about successful files.
What if we need to restore now then?
icacls c:\windows\ /restore AclFile /T /C /Q

So lets break this command up

/restore = command to excute

Problems?

Well a standard problem is that you saved the acls using “icacls E:\Shares /save….” and are
trying to restore using “icacls F:\Shares /restore…”. The ACL file does contain the path in the
command. So in that case I would suggest changing the directory in the command Prompt so
you could run the command as “icacls .” instead.

A vy neznáte ROBOCOPY?

Velice často po mě moji známí či menší zákazníci požadují nějaké „udělátko“, pomocí
kterého by mohli jednoduše zálohovat vybrané soubory a složky, a zároveň se
nemuseli starat o aktualizace či verzování záloh. Prostě jen chtějí mít na nějakém
externím disku či flashce zrcadlený obsah svých důležitých dat. A právě (a nejen)
k tomuto účelu se ve světě Windows perfektně hodí příkaz ROBOCOPY.S trochou
nadsázky se dá říci, že se jedná o rozšířenou verzi příkazů Windows shellu COPY,
resp. XCOPY. ROBOCOPY však využívá mnoho speciálních parametrů, dokáže
kopírovat nastavení zabezpečení, upravovat atributy souborů a spousty dalších
užitečných vychytávek.

Jak plyne z výše uvedeného, budeme používat příkazovou řádku, ale nebojte se je to
velice jednoduché. Pokud jste v tomto začátečníci, klikněte v nabídce Start na
příkaz Spustit…, napište cmd a stiskněte Enter. Objeví se okno shellu. Můžete na
zkoušku vepsat do příkazové řádky příkaz ROBOCOPY jen tak, bez parametrů – po
odentrování se zobrazí stručná nápověda (kompletní podrobnou nápovědu zobrazíte
příkazem ROBOCOPY /?).
použití ROBOCOPY v příkazové řádce

Základní použití je ROBOCOPY zdroj cíl, tedy například ROBOCOPY „C:\Moje zdrojová
složka“ „F:\Moje cílová složka. Pokud chcete dosáhnout efektu zrcadlení dat (tj. že
na cílovém disku se po dokončení operace vždy objeví totožná data jako na
zdrojovém, přidejte na konec příkazu parametr /MIR. Příkaz se pak postará o to, že
porovná soubory v cíli se soubory zdrojovými, nakopíruje do cíle jen nové či
změněné soubory, případně vymaže z cílového disku/složky ty soubory, které se již
nenacházejí ve zdroji.

Uvedeme si zde příklad, jehož zadání zní:

Zkopíruj (vytvoř zrcadlo) domovskou složku (včetně všech, i prázdných podadresářů)


uživatele Petr z disku C na flash disk F do složky Zaloha.

Řešení:
ROBOCOPY C:\Users\Petr F:\Zaloha /E /MIR /XJ /R:0

Parametry „/XJ“ a „/R:0“ nejsou nutné, nicméně doporučuji je (především ve


Windows Vista a 7), protože vyloučí z kopírování spojovací body a zamezí
mnohočetné opakování pokusu o kopírování souborů s chybou (v podstatě tak
zabráníte možnému zacyklení příkazu a zároveň zvýšíte rychlost operace).

Ti zdatnější z Vás si pak mohou vytvořit vlastní script pro zálohování, jehož vzorek
(který já sám hojně používám) si můžete stáhnout zde (zalohovani.zip).
Nezapomeňte jej spouštět jako správce, jinak se může stát, že nedojde k úspěšnému
zkopírování všech požadovaných souborů a složek.

ROBOCOPY ale není jen hračka pro domácí uživatele. Lze jej bezpečně použít i pro
zálohování velkých objemů dat na zálohovací zařízení nebo do cloudu, především
díky spoustě parametrů a možností, které přináší.
Kompletní syntaxi a dokumentaci příkazu najdete na Microsoftím TechNetu. Pro ty,
kdo se bojí příkazové řádky a raději klikají, mohu vřele doporučit grafické
klikátko Microsoft Robocopy GUI.

Na závěr ještě malé upozornění: Příkaz ROBOCPY je standardní součástí OS Windows


Vista, 7, 8, 10, Windows Server 2008, 2012, 2016. V historických verzích, např. ve
Windows XP nebo Windows Server 2003 jej standardně nenajdete, musíte si
stáhnout z webu Microsoftu Windows Server 2003 Resource Kit Tools.

*hezký den,
parametr /E je již obsažen v parametru /MIR.

*Máte samozřejmě pravdu, díky za upozornění. Sice současné použití parametrů /E a /MIR
ničemu neublíží, ale je to zbytečné.
Případně lze namísto /MIR použít kombinaci /E /PURGE – výsledek bude stejný.
JK

How to delete large folders in Windows super fast - gHacks


Tech News
by Martin Brinkmann on July 18, 2017 in Windows - Last Update: July 18, 2017 - 43
comments

When you delete huge folders in Windows, you will notice that the process takes quite a bit of
time to complete.

I keep backup folders of Ghacks locally on a platter-based drive, and these folders come close
to 30 Gigabytes in size with more than 140,000 files and 350 folders.

When I need to delete them again, it takes a long time if I run the delete operation in
Windows Explorer. First thing that happens is that Windows runs calculations which in itself
may take a very long time to complete.

Then when the actual deleting takes place, Windows analyzes the process and posts updates to
the file operation window.

It may take ten or twenty minutes, or even longer, to delete a large folder using Explorer on
Windows devices.
How to delete large folders in Windows super fast

If you run delete commands from the command line instead, you will notice that the operation
completes a lot faster. You may notice that the operation needs just a fraction of time that the
same operation requires when you run it in Explorer.

Matt Pilz, who wrote about this back in 2015 saw a reduction from 11 minutes to 29 seconds,
which made the command line operation more than 20 times faster than the Explorer option.

The downside to this is that it requires use of the command line. Matt suggested to add the
commands to the Explorer context menu, so that users could run them in Explorer directly.

The two commands that users require are Del, for deleting files, and Rmdir, for removing
directories.

1. Tap on the Windows-key, type cmd.exe and select the result to load the command
prompt.
2. Navigate to the folder that you want to delete (with all its files and subfolders). Use cd
path, e.g. cd o:\backups\test\ to do so.
3. The command DEL /F/Q/S *.* > NUL deletes all files in that folder structure, and
omits the output which improves the process further.
4. Use cd.. to navigate to the parent folder afterwards.
5. Run the command RMDIR /Q/S foldername to delete the folder and all of its
subfolders.

The commands may require some explanation.

DEL /F/Q/S *.* > NUL


 /F -- forces the deletion of read-only files.
 /Q -- enables quiet mode. You are not ask if it is ok to delete files (if you don't use
this, you are asked for any file in the folder).
 /S -- runs the command on all files in any folder under the selected structure.
 *.* -- delete all files.
 > NUL -- disables console output. This improves the process further, shaving off
about one quarter of the processing time off of the console command.

RMDIR /Q/S foldername

 /Q -- Quiet mode, won't prompt for confirmation to delete folders.


 /S -- Run the operation on all folders of the selected path.
 foldername -- The absolute path or relative folder name, e.g. o:/backup/test1 or test1

Creating a batch file and adding it to the Explorer context menu

If you don't need to run the command often, you may be perfectly fine running the commands
directly from the command prompt.

If you do use it frequently however, you may prefer to optimize the process. You may add the
command to the Explorer context menu, so that you can run it from there directly.

First thing you need to do is create a batch file. Create a new plain text document on
Windows, and paste the following lines of code into it.

@ECHO OFF
ECHO Delete Folder: %CD%?
PAUSE
SET FOLDER=%CD%
CD /
DEL /F/Q/S "%FOLDER%" > NUL
RMDIR /Q/S "%FOLDER%"
EXIT

Save the file as delete.bat afterwards. Make sure it has the .bat extension, and not the .txt
extension.

The batch file comes with a security prompt. This provides you with options to stop the
process, important if you have selected the context menu item by accident. You can use
CTRL-C or click on the x of the window to stop the process. If you press any other key, all
folders and files will be deleted without any option to stop the process.

You need to add the batch file to a location that is a PATH environmental variable. While you
may create your own variable, you may also move it to a folder that is already supported, e.g.
C:\Windows.
Do the following to add the new batch file to delete folders quickly to the Windows Explorer
context menu.

1. Tap on the Windows-key, type regedit.exe and tap in the Enter-key to open the
Windows Registry Editor.
2. Confirm the UAC prompt.
3. Go to HKEY_CLASSES_ROOT\Directory\shell\
4. Right-click on Shell and select New > Key.
5. Name the key Fast Delete
6. Right-click on Fast Delete, and select New > Key.
7. Name the key command.
8. Double-click on default of the command key.
9. Add cmd /c "cd %1 && delete.bat" as the value.
Advertisement

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks
are hit hardest by it. The advertising model in its current form is coming to an end, and we
have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no
sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Thanks for visiting ghacks.net


In order to run a successful website, we and certain third parties are setting cookies and
accessing and storing information on your device for various purposes. Various third parties
are also collecting data to show you personalized content and ads. Some third parties require
your consent to collect data to serve you personalized content and ads.

Mass deleting files in Windows


I regularly need to delete lots of files and directories from a WinXP encrypted drive,
typically around 22 GB of 500,000 files in 45,000 folders.
Deleting with Windows Explorer is rubbish because it wastes lots of time enumerating
the files. I usually move the stuff I need to delete to C:\stufftodelete and have a
deletestuff.bat batch file to rmdir /s/q C:\stufftodelete. This is scheduled to run at
night, but sometimes I need to run it during the day so the quicker the better.
Here's the results of a quick time test of a small 5.85 MB sample of 960 files in 303
folders. I ran method 1 followed by method 2, then reset the test directories.

Method 1 removes the files and directory structure in one pass:

rmdir /s/q foldername


Method 2 has a first pass to delete files and outputs to nul to avoid the overhead of
writing to screen for every singe file. A second pass then cleans up the remaining
directory structure:

del /f/s/q foldername > nul


rmdir /s/q foldername
 Method 1: 17.5s, 14.9s, 13.9s, 14.8s, 13.8s: average 14.98 seconds
 Method 2: 14.3s, 12.1s, 11.7s, 14.2s, 11.8s: average 12.82 seconds
Here's results of another test using 404 MB of 19,521 files in 3,243 folders:

 Method 1: 2 minutes 20 seconds


 Method 2: 2 minutes 33 seconds
So there's not much in it, probably too close to judge on a single test.

Edit: I've retested with much more data, this is a typical case for me: 28.3 GB of
1,159,211 files in 146,918 folders:

 Method 1: 2h 15m, 2h 34m: average: 2 hours 25 minutes


 Method 2: 49m, 57m: average: 53 minutes
Wow, method 2 is nearly three times faster than method 1! I'll be updating my
deletestuff.bat!

How to Speed Up Folder Deletion Times by 20x or More!


The common way of deleting files and folders in Windows is via Windows
Explorer (a.k.a. File Explorer). This method is perfectly acceptable under normal
circumstances, but becomes a real drag when dealing with large and complex folder
structures. There is, in fact, a significant amount of of overhead when you trigger the standard
delete action in Windows including when either emptying the Recycle Bin or directly deleting
files via Shift+Del.

Upon flagging a folder for deletion in the traditional fashion, Windows begins by calculating
the total folder size, number of items contained within it, and the estimated completion time.
This "Preparing to Delete" phase can consume a sizable amount of time itself depending on
the contents being deleted. During the actual deletion process, Windows continues to query
and report various statistics about the process including how many items are deleted per
second, how many remain, the current item being deleted and so forth. You may also be
prompted via the Windows dialog if any conflicts arise during the process.
As an example of folder complexity, I have recently been doing a lot of tests with various
iterations of the Android NDK across several development machines. The latest Android
NDK (r10e) is comprised of around 50,000 Files across 4,100 Folders and totals
over 3.15GB in size. Deleting this directory in its extracted format can take up to fifteen
minutes when using native Windows Explorer file operations, versus just seconds using the
method described below.

Deleting a large and complex folder via Windows Explorer can take a long time.

A much faster, bare metal approach to deleting large and complex folders in Windows is via
the command line. Of course, repeatedly having to navigate directories while executing
commands via a terminal quickly becomes a tedious experience. In this post, I will walk
through the process of creating a simple batch file and wiring it up to a handy right-click
context menu from Windows Explorer to delete sophisticated directories in a hurry and
without interruption.

Deleting Files and Folders via Command Prompt

The commands required to perform folder and file delete operations via Command
Prompt are quite straightforward.

Files can be deleted using the DEL (a.k.a. ERASE) command.


DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

There are a handful of optional parameters that can be appended to the DEL command to
control its behavior. To see a description of each, enter DEL /? from the command prompt.
The most important flags when wishing to delete all files across all nested directories include:

 /F - Force deleting of read-only files.


 /Q - Quiet mode, do not ask if ok to delete on global wildcard.
 /S - Deletes specified files from all subdirectories.

To delete all files in a particular directory and its subdirectories, you would first navigate to
the directory in question using cd [PATH] and then execute the following line:

If you omit the /Q flag, you would have to manually verify the deletion of every single file—
obviously not what you want when trying to delete a folder's contents as quickly as possible.
Likewise, without the /F flag, any files set to read-only would be ignored and would remain
in-tact after the command has completed. The /S flag is significant as without it you would
only be deleting all of the files in the root active directory.

While this method avoids the calculation expense required when deleting through Windows
Explorer, the command as shown above will still output the location and deletion status of
each file in the iteration. Although this can prove valuable at times, when iterating through
thousands of files such output can congest the command's performance. We can instead
redirect output to a null location to avoid any on-screen rendering, as such:

Although it may seem like a moot point, the speed gained by merely omitting output is still
quite measurable especially when deleting a massive number of items. Upon deleting
the ~46,000 filesfrom the NDK package, it took 38 seconds with console
output enabled and 29 seconds with output disabled on a standard non-SSD hard drive,
scraping off a quarter of the time. By comparison, the same deletion process via a
standard Shift+Del in Windows Explorer took an agonizing 11 minutes.

Therefore, using the above command-line operation was over 20 times faster than going
through Windows Explorer itself. [Note: When sending a folder to the Recycle Bin via
Windows Explorer, it may seem to delete fairly fast on modern editions of Windows, but will
still take substantial time when emptying from the Recycle Bin.]

Folders can be deleted using the RMDIR (a.k.a. RD) command.


RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

Like the DEL command, There are a couple optional parameters that can be appended to
the RMDIRcommand to control its behavior. Both of these flags are essential when wishing to
delete a folder and all of its sub-folders as fast as possible with no prompts:

 /Q - Quiet mode, do not ask if ok to remove a directory tree


 /S - Removes all directories and files in the specified directory in addition to the
directory itself.

Technically, the RMDIR command with the above flags should be sufficient enough on its own
to remove an entire directory tree in most cases. However, Microsoft's documentation warns
that this command "cannot delete a directory that contains files, including hidden or system
files." I believe that this statement is more applicable to older operating systems such as XP,
likely to resolve malicious security flaws from the older DELTREE and PURGE commands.
Regardless, I still prefer to run the DEL command described previously to ensure each file
including read-only has been forcibly deleted before deleting the folders themselves
via RMDIR. There is no measurable speed penalty for using both commands over just one.

To delete a particular directory and all of its subdirectories, you must enter the command:

RMDIR /Q/S [Absolute Path or Relative Folder Name]

Note that this command will not work if you are currently in the directory trying to be deleted.
Instead you should navigate to the parent directory via CD.. and then call the command by
referencing the target folder.

Let's Make a Batch File

To enable this functionality without having to continuously enter these commands, we will
make a self-contained batch file. I recommend creating a dedicated folder on your hard drive
to store small utility programs and batch files, such as 'C:\Programs'. Launch Notepad and
paste the following snippet into it.

ECHO Delete Folder: %CD%?


DEL /F/Q/S "%FOLDER%" > NUL

When done, select File > Save As and save it as "fastdel.bat" in quotes to your folder of
choice (i.e., C:\Programs\). I have added a very basic prompt via the PAUSE command to
allow a single opportunity to abort the deletion process. As soon as you press any key
[except CTRL+C to abort or pressing 'X' in corner to close window] the files and folders
will be permanently and immediately deleted with the only possible chance of recovery
via a third party software recovery application.

This batch file uses the currently active directory as the one to delete. It first stores this
working directory in the FOLDER variable, then navigates to the root drive directory to avoid
any operation conflicts. The DEL and RMDIR commands are then called on the original folder
and the window will terminate upon completion. Be warned that if you double-click the batch
file directly, the folder it resides in will be the target of deletion, so it would delete itself and
any siblings or descendants! If you are exceptionally concerned about misfiring this batch file,
you could create a more advanced 'Yes/No' confirmation prompt for verification using basic
batch file commands.

To enable calling of this fast delete batch file from any computer directory, add the file's
directory location to your PATH environmental variable as follows:

1. Press WINDOWS KEY + PAUSE/BREAK on your keyboard to open the System


Information screen.
2. Click on the Advanced System Settings link on the left.
3. Under the Advanced tab in the System Variables section, double-click
the PATH variable row.
4. At the end of the Variable Value field, ensure there is a semicolon (;) and then add
the full directory location to the batch file (i.e., C:\Programs\).
5. Click OK to close the Edit System Variable prompt, OK again to close
the Environmental Variables window, and OK again to close the System Properties.

With this in place, you should be able to open a new command prompt, navigate to any
directory you wish to delete, then type FASTDEL to launch the folder deletion process.

Add Fast Delete Option to the Right-Click Context Menu

All that remains is to add an option to Explorer's Context Menu so that we can right-click
any folder and select Fast Delete from the pop-up menu. This adds the convenience of not
having to manually launch a Command Prompt window or enter any console commands
yourself. You'll have to dig into the Registry to accomplish this, but it is very simple:

1. Press WINDOWS KEY + R on your keyboard to open the Run dialog box.
2. Enter regedit and press ENTER.
3. Navigate to HKEY_CLASSES_ROOT\Directory\shell\
4. Right-click on the yellow shell key and select New > Key.
5. Enter the name: Fast &Delete then press ENTER.
6. Right-click on the yellow Fast &Delete folder just created, then select New > Key.
7. Enter the name: command then press ENTER.
8. Left-click on the yellow command key just created, then double-click
the (Default) entry.
9. In the Value Data field, enter: cmd /c "cd %1 && fastdel.bat" then press OK.

Now when you open Windows Explorer / My Computer and navigate to a directory you
wish to delete, you can right-click on it and should see the "Fast Delete" option in the menu.
The ampersand before the 'D' when creating the key is optional, but will allow you to simply
press 'D' after right-clicking a folder to call the fast delete command. WARNING: If you use
this keyboard shortcut instead of simply left-clicking the command option, the PAUSE line in
the batch file I provided will override and the folder will delete immediately. Again, for safety
reasons you may wish to implement a more elegant Yes/No prompt as suggested earlier; as a
power user I prefer things to happen quickly with as little user input as necessary.
Note: If you have Cygwin installed and configured, you can also remove directories and files
via rm -rf [path]. However, my own tests did not reveal any measurable speed
improvements over the integrated method described in this article.

November 16, 2015 Update: I recently observed that the original batch file script I provided
above did not compensate for paths with spaces in them. For example, if you had two folders
'Test' and 'Test Two' and right-clicked 'Test Two' to delete via the script, it would actually
find the 'Test' folder and delete its contents instead. This has been amended by surrounding
the paths in quotes.

Rapid Delete Pro


https://github.com/mhisoft/Rapid-Delete-Pro

Fast Delete Complex Directories


Normally, deleting directories is fairly quick when they contain a modest number of sub-
directories and files. But if directories have complex structures, consisting of hundreds or
thousands of sub-directories and files, it may take several minutes or even hours to delete
them. The command line, with less overhead, may delete complex directories in a fraction of
that time, often quoted as being 20 times or more faster than the traditional explorer option.
This guide shows how a batch file may be used to automate deleting large directories using
batch files or the command line.

Explorer can be extremely slow when deleting directories because it calculates the folder size,
the number of items in the folder, and the estimated completion time before processing, and
reports on the items deleted, remaining deletions, current deletions, and while monitoring and
reporting on any conflicts during processing. These processes are still in effect even when the
recycle bin is emptied or when files and folders are deleted directly using Shift+Del. Using
the command line eliminates this overhead, resulting in a faster deletion process.
Commands

Two main commands act as a two-step process for deletion in the batch scripts:

del /f/q/s "%folder%" > nul


Acts as a first pass to delete files and outputs to nul to avoid the overhead of writing to the
screen

rmdir /q/s "%folder%"


Removes the directory structure

 /f – Force delete read-only files


 /q – Quiet mode, do not ask to delete
 /s – Include subdirectories

Another method for deleting folder files is Robocopy. A destination folder is mirrored from
an empty source directory, which forces Robocopy to delete any files not in the source
directory.

The main command for Robocopy:

robocopy "EmptyDir" "DestinationDir" /MIR /ETA /R:30 /W:4

 /MIR – Mirror a directory


 /ETA – Estimated Time
 /R:30 – Number of retries
 /W:4 – Time between retries (secs)

In the example batch files, RMDIR is still used to remove empty directories, and DEL deletes
individual files

Using Batch Files

Batch files, including the example files below, may be used from the command line (with
parameters), from the send-to directory, the right-click context menu, or by drag and drop (the
easiest method).

Command line

The batch files may be executed from a Windows command prompt with parameters, or
added to the environmental path for convenience.

To execute from a command prompt, open a new cmd prompt, navigate to the batch file’s
location and enter its full name, or enter the batch file’s full path. Be sure to add the
directories and/or files to delete as parameters. Also include quotes around any file paths with
spaces:

Ex. “C:\Program Files\delete_file_folder_fast_simple_v2.bat” “C:\Folder or file to delete”

Separate multiple parameters with a space between parameters.

Adding a batch file’s folder to the Windows environment variable allows it to be available
from any cmd prompt without navigating to the batch file’s location or typing its full path. To
add a batch file’s path to the Windows environment use:

start–> Control Panel–> System–> Advanced system settings–> Advanced Tab–>


Environment Variables–> System Variables–> Path–> Edit.

Add the path e.g., ;C:\path to the batchfile; to the end (don’t forget the single semicolons at
the beginning and end). Hit OK three times.

Right-click Context Menu

This option allows the user to right-click a folder and select the batch file from the pop-up
menu. The steps to enable this are:

1. Press the WINDOWS KEY + R to open the Run dialog box


2. Enter regedit and press ENTER
3. Navigate to HKEY_CLASSES_ROOT\Directory\shell\
4. Right-click on the yellow shell key. Select New > Key
5. Enter a name: Delete &Fast then press ENTER
6. Right-click on the Delete &Fast folder created, and select New > Key
7. Enter “command” and press ENTER.
8. Left-click on the yellow command key created. Double-click the (Default) entry.
9. In the Value Data field, enter the batch file to use, e.g., cmd /c \”C:\\Path
to\\delete_file_folder_fast_simple_v2.bat\” %1″ then press OK

Another way to accomplish the above is to use a reg file. Copy the code below, paste it into a
file editor and save it as “Delete Fast.reg”. Double click the file to merge its contents to the
registry and the right-click menu is ready to use.

Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\Del


ete &Fast\command] @="cmd /c \"C:\\Path
to\\delete_file_folder_fast_simple_v2.bat\" %1"

Send to Directory

Another option is the Send to directory, Just create a shortcut and add it to the appropriate
directory:
For newer versions of Windows, the send to directory is located at:

C:\Users\<yourusername>\AppData\Roaming\Microsoft\Windows\SendTo

For XP, the location is:

C:\Documents and Settings\<yourusername>\SendTo

To use, right click a file or directory and select the batch file from the Send to menu.

Drag and Drop

The example batch files support drag and drop. Just drag and drop onto a batch file to delete
files and folders.

Differences in the Example Batch Files

delete_files_folders_fast_v2.bat – lists multiple files and folders to be deleted, the parent


directory, limited folder/file attributes, and limited information on the names and numbers of
files and folders deleted. Also includes a delayed exit, allowing the files and folders deletion
information to be reviewed before the window closes (default 10 seconds).

delete_file_folder_fast_simple_v2.bat – limited to deleting one file or one folder at a time.


Doesn’t provide much interaction or feedback except to ask the user if they actually want to
delete the displayed file or folder.

delete_files_folders_fast_robocopy_v2.bat – essentially the same


as delete_file_folder_fast_simple_v2.bat except that Robocopy’s output is displayed during
execution and after processing files. The batch file is paused after execution allowing the user
to view the results without automatically exiting.

delete_file_folder_fast_simple_robocopy_v2.bat – almost identical in operation


to delete_file_folder_fast_simple_v2.bat except that it uses Robocopy instead of DEL for
deleting a folder or file, and Robocopy output is redirected to nul to eliminate command
output. Users shouldn’t see any difference between them except possibly in performance.

The batch files may be renamed and will work identically.

Example Batch Files

Left-click to view the file in the current window, or use right-click and “Save Link As” to
download.The batch files are changed from the previous versions as the /S switch greatly
slowed performance when deleting individual files. The /S switch is still used, but only for
folders.
Note: Remove the “.txt” extension before using.
The batch files below use only the RMDIR and DEL commands.

delete_files_folders_fast_v2.bat (4.0 KiB, 178 hits)

delete_file_folder_fast_simple_v2.bat (1.2 KiB, 126 hits)

The below batch files use Robocopy to delete folder files, RMDIR to delete empty folders,
and DEL to delete individual files. If Robocopy is installed but not included in the Windows
environment path, be sure to change the path for Robocopy for your system in the batch file
(don’t forget to remove the REM to enable it). No changes to the batch files are required if
Robocopy is already installed and included in the path. To check, type “robocopy: in a
command prompt. If Robocopy executes, it’s already installed and included in the
environment path.

delete_files_folders_fast_robocopy_v2.bat (4.8 KiB, 132 hits)

delete_file_folder_fast_simple_robocopy_v2.bat (1.7 KiB, 137 hits)

How to delete a large folder extremely fast on Windows 10 •


Pureinfotech
Using this process, you can delete thousands of files and folders in the matter of seconds on
Windows 10, not minutes or hours.
On Windows 10, sometimes you need to delete folders that may contain a large number of
files, and using File Explorer can take a long time. The reason is that during the delete
process, Windows 10 needs to run calculations, analyze, and show updates as files and folder
are deleted, something that usually takes time when deleting a large folder with thousands of
files and subfolders.

However, using a few command lines, you can significantly speed up the process to just a few
seconds. The only caveat is that you need to be comfortable using Command Prompt.

In this guide, you’ll learn the fastest way to delete large folders with thousands of files using
command lines based on a Ghacks’ guide, and the instructions to add an option on the right-
click context menu to automate the process with just one click.

How to delete a large folder fast using Command Prompt

In order to delete a large number of files, which otherwise will take a lot of time, you’ll need
to use the del and rmdir commands using these steps:

1. Open Start.

2. Search for Command Prompt, right-click the result, and select Run as
administrator.

3. Browse the folder path that you want to delete. For example, C:\Users\your-user-
name\Documents\CarShow.

4. Type the following command to delete all the files in that folder without showing the
output and press Enter:

del /f/q/s *.* > nul

In the above command, we use the /f switch to force the deletion of read-only files.
The /qswitch enables quiet mode. The /s switch executes the command for all files in
any folder inside the folder you’re trying to remove. Using *.* tells the del command
to delete every file, and > nul disables the console output improving performance and
speed.

5. Type the following command to go back one level in the folder path and press Enter:

cd..

6. Type the following command to delete the folder and all its subfolders and
press Enter:

rmdir /q/s your-folder-name


In the above command, we use the /q switch to enable quiet mode, the /s switch to run
the command on all the folders, and your-folder-name is the variable you need to
specify to delete the folder you want.

Del and rmdir commands

How to automate the process adding a context menu option

If the command lines aren’t your thing, you don’t usually delete tons of files, or you’re just
looking for a faster way, it’s possible to add a right-click context menu option that will run
batch file for the data you want to delete.

To add a context menu option that will delete files and folder extremely fast use the following
steps:

1. Open Notepad.

2. Copy and paste the following lines into the Notepad text file.

3. @ECHO OFF

4. ECHO Delete Folder: %CD%?

5. PAUSE

6. SET FOLDER=%CD%

7. CD /

8. DEL /F/Q/S "%FOLDER%" > NUL


9. RMDIR /Q/S "%FOLDER%"

EXIT

10. Click on File and select Save As.

11. Save the file as quick_delete.bat, but make absolutely sure it uses the .bat extension.
If you save it with an .txt extension, this will not work.

12. Move the quick_delete.bat file to C:\Windows. This step is necessary, because the
file need to be on a location that has a path environmental variable, but you can always
create your own if you’re up to the challenge.

Windows folder

13. Open Start.

14. Search regedit, right-click the result, and click Run as administrator.

15. Navigate to the following path:

HKEY_CLASSES_ROOT\Directory\shell\

Quick Tip: You can copy and paste the path in the address bar of the Registry if
you’re running the Windows 10 Creators Update.

16. Right-click the Shell (folder) key, and select New and click Key.
Shell Registry key

17. Name the key Quick Delete and press Enter.

18. Right-click the newly created key, select New and click Key.

19. Name the key command and press Enter.

20. Double-click the command key default String on the right side.

21. Change the value of the key with the following line and click OK.

cmd /c "cd %1 && quick_delete.bat"


Command to delete folders and files fast

Once you’ve completed the steps, you can right-click a folder and select Quick Delete to
remove a large folder super fast.
Context menu with new Quick Delete option

While executing command you’ll get a security prompt which will prevent you from deleting
files by accident. You can then press any key to proceed, or use the Ctrl + C keyboard
shortcut or click the X button to cancel the operation.

4 Free Ways to Quick High-level Format SD/USB/Hard Drive –


EaseUS

Summary:
Need a quick method to effectively remove all saved data on your storage devices
like SD card, USB or hard drive? Here this page will offer you four free ways to guide
you effectively perform a quick high-level format on SD/USB/HDD etc. devices with
simple clicks on Windows 10/8/7 PCs. Follow and try to quick high-level format SD,
USB or hard drive on your own now.
Can I quickly format SD, USB or hard drive with huge data?

"Hi there, do you know a quick and effective way to format and erase huge data on SD card,
USB or hard drive in Windows 10?

I bought a 2TB external hard drive recently, and I've transferred all essential data and files
from my SD, USB, and HDD into the new drive. Now I need a reliable way that can help me
quickly remove and clean up all files and data on SD, USB and hard drive. I know that
deleting files on storage devices won't really clear all data. Some hidden files may still linger.

So I want to know that if I can quickly format my SD card, USB and hard drives and make
these devices reusable for saving new data again in Windows 10?"

According to Wikipedia, High-level formatting will set up a file system and empty a device so
to quickly make it available for storing new data. High-level formatting is also called quick
format, which means that you can make SD card, USB or hard drive partition etc. devices
reusable soon for saving new data by high-level format.

You may follow below-offered tips to directly quick format SD/USB/HDD etc with high-
level formatting now.

Way 1. Quick high-level format SD/USB/hard drive in 3 steps

If you prefer a simple and easy way to high-level format SD card, USB or hard drive etc. in
Windows PC, professional free partition manager software - EaseUS Partition Master Free
can be your best choice.

You can download and install it for free on your Windows PC and follow below tips to
quickly make your SD, USB or hard drive etc devices usable again by high-level formatting
now:

Step 1: Launch EaseUS Partition Master, right-click the partition on your external hard
drive/USB/SD card which you want to format and choose the "Format" option.
Step 2: Assign a new partition label, file system (NTFS/FAT32/EXT2/EXT3), and cluster
size to the selected partition, then click "OK".
Step 3: In the Warning window, click "OK" to continue.
Step 4: Click the "Execute Operation" button in the top-left corner to review the changes,
then click "Apply" to start formatting your external hard drive/USB/SD card.
The formatting process will complete within seconds. And then you can reuse SD, USB or
other devices to save data again.

Way 2. High-level format SD/USB/hard drive in This PC/My Computer

If you prefer a direct way to format SD, USB or hard drive etc. in Windows 10, 8 or 7, you
can directly right-click to format them in This PC or My Computer with below steps:

Step 1. Connect SD/USB/hard drive to Windows PC;


Step 2. Open "This PC or My Computer", find and right-click on SD card, USB or the hard
drive that you need to quick format;
Step 3. Select "Format..." > reset the File system to NTFS and rename the device > Check
"Quick Format" box and click "Start" to a high-level format target device.
Step 4. Click OK to complete all format process.
Way 3. Use Disk Management to high-level format SD/USB/HDD

The other way is to use Disk Management in Windows system to quickly high-level format
storage devices. Follow to see how to high-level format SD/USB etc with Disk Management
now:

Step 1. Connect SD/USB or hard drive to Windows PC;


Step 2. Right-click on "This PC/My Computer" and select "Manage".
Step 3. Select "Disk Management", find and right-click on target SD or USB etc devices that
you want to format and select "Format..."
Step 4. Rename the device label and reset the device File system to "NTFS" or "FAT32".
Step 5. Check "Perform a quick format" box and click "OK" to start quick format selected
device then.

Way 4. Run CMD command to quick high-level format SD/USB/hard drive

Another way that you can try is to run CMD command to quickly format your SD, USB or
hard drive with below steps:

1. Step 1. Connect SD/USB or hard drive that you need to quick format to your PC.
2. Step 2. Right-click "Start" button and select "Command Prompt (Admin)", enter your
administrator account and password.
3. Step 3. Type: format I: /fs: NTFS /q and hit Enter.

If you need to format device to FAT32 file system, replace "NTFS" with "FAT32".
And replace I: with the drive letter of your SD card, USB or hard drive that you need to high-
level format.

Step 4. When the quick format process complete, type: exit and hit Enter to close CMD
window.
Copying files with long names robocopy. Where are
my files, ROBOCOPY
The site reader, Ivan, sent the following question:

Good afternoon, help me with one question, I need to make a script program that would back
up files, I will explain in more detail. In this program, you need to specify from which folders
the files are copied, but not all, but updated for the last day, I need to copy them to a shared
folder on another computer. My actions were such, I am writing a program with the robocopy
command, then I wanted to make a constant execution through the task scheduler. Tell me
how to write a command correctly, I’m not good at programming, I don’t know how to
correctly specify a network name, thanks in advance. Ivan

What is robocopy?

This is a utility. command line Windows to copy files from one folder to another. Moreover,
it is not just copying, the utility performs replication. Unfortunately, I have no experience
using this utility, but I understand that this is something like rsync in unix. This is very
convenient for, for example.

Robocopy examples

In general, the command syntax is simple. Specifies the source folder and the destination for
replication. If you copy to the network storage, the host name is first written. Standard
network path begins with two backslashes:

Robocopy C: \\ folder \\ \\ backupserver \\ backup

You can even copy from one server to another:

Robocopy \\\\ myServer \\ myFolder \\ myFile.txt \\\\ myOtherServer \\ myOtherFolder

Full description of utility options

On the Internet, there was such a smart sign, which gives comprehensive information on using
the utility:
ROBOCOPY Syntax

ROBOCOPY source assignment [file [file] ...] [Parameters]

Source :: Source folder (drive: \\ path or \\\\ server \\ share \\ path).


Purpose :: Destination folder (drive: \\ path or \\\\ server \\ share \\ path).
File :: Copy files (names and wildcards: the default is "*. *").

Before windows versions Vista was shipped as part of the Resource Kit. Starting from
Windows Vista is presented as a standard component.

Copy options
/S Copy subfolders except empty ones.
/E Copy subfolders, including empty ones.
/ LEV: n Copy only the top n levels of the source folder tree.
/Z Copy files with resume.
/B Copying files in archive mode.
/ Zb use resumption mode; if access is denied, archiving mode is used.
/ EFSRAW Copy all encrypted files in EFS RAW mode.
what is copied to files (default is / COPY: DAT). (copy flags: D = Data, A =
/ COPY: copy Attributes, T = Timestamps). (S = Security = NTFS ACLs, O = Owner Details, U =
flags Audit Details).
/ DCOPY: T Copy folder time stamps.
/ SEC Copy files with security settings (equivalent to / COPY: DATS).
/ COPYALL Copy all file information (equivalent to / COPY: DATSOU).
Do not copy any information about the file (convenient to use with the /
/ NOCOPY PURGE parameter).
/ SECFIX Correct security settings for all files, even missing.
/ TIMFIX Correct time attributes for all files, even missing ones.
/ PURGE Delete files and destination folders that no longer exist in the source.
/ MIR Create a mirror of the folder tree (equivalent to / E with / PURGE).
/ Mov Move files (delete from source after copying).
/ MOVE Move files and folders (delete from source after copying).
/ A +: Add specified attributes to copied files.
/ A +: Delete the specified attributes from the copied files.
/ CREATE Create only a tree of folders and files of zero length.
/ FAT Create destination files in 8.3 FAT format only.
/256 Disable long path support (\u003e 256 characters).
/ MON: n Watch the source; restart after n changes.
/ MOT: m Watch the source; restart in m minutes if changes occurred.
/ Rh: hhmm-
hhmm Startup Hours is the time when you can start a new copy.
/ Pf Check start time by file (not by pass).
/ IPG: n Packet spacing (ms) to reduce network load for low-speed connections.
copying the symbolic links themselves instead of copying the target of these
/ Sl links.
File selection options
/A Copy only files from set attribute "Archival".
/M Copy only files with the “Archive” attribute and reset it.
/ IA: Include files that have any of the specified attributes set.
/ Xa: Exclude files that have any of the specified attributes set.
/ XF file [file]
... Exclude files matching specified names, paths and wildcard characters.
/ Xd dirs
[folders] ...
Exclude folders matching specified names and paths.
/ XC Exclude modified files.
/ XN Exclude later files.
/ Xo Exclude earlier files.
/ Xx Exclude additional files and folders.
/ XL exclude separately placed files and folders.
/ Is Include the same files.
/ IT Include optimized files.
/ MAX: n Maximum file size - exclude files that are larger than n bytes.
/ MIN: n Minimum file size - exclude files that are less than n bytes in size.
/ MAXAGE: n Maximum file age - exclude files that are older than n days.
/ MINAGE: n Minimum file age - exclude files that are less than n days old.
The latest date of the last access is to exclude files that have not been used
/ MAXLAD: n since date n.
The earliest last access date is to exclude files that were used after date n. (If
n< 1900, то n = n дней, в противном случае n — дата в формате
/ MINLAD: n ДДММГГГГ).
/ Xj exclude connection points. (usually included by default).
/ Fft Use time files FAT (two-second accuracy).
/ DST Take into account the one-hour difference in the transition to summer time.
/ Xjd Exclude junction points for folders.
/ Xjf Exclude junction points for files.
Retry options:
Logging options:
/L List only - files are not copied, deleted, not marked with time stamps.
/X Report all additional files, not just selected ones.
/V Detailed output indicating the missing files.
/ TS Include the timestamps of the source files in the output.
/ Fp Include full file paths in the output.
/ BYTES Print sizes in bytes.
/ NS Without size - do not log files size.
/ Nc Without class - do not log file classes.
/ Nfl Without a list of files - do not log file names.
/ NDL Without a folder list - do not log folder names.
/ NP Without progress - do not display the number of copied%.
/ Eta Show an estimate of the end time of copying files.
/ LOG: file Write status to log file (overwrite existing log).
/ LOG +: file Write state to log file (add to existing log).
/ UNILOG: file Write the state to the log file in Unicode format (overwrite the existing log).
/ UNILOG +: file Write state to log file in Unicode format (add to existing log).
/ TEE Send output to the console window and to the log file.
/ Njh No job title.
/ Njs Without information about the task.
/ UNICODE Unicode output state.
Task parameters:
Notes

The robocopy utility (“Robust File Copy” = “secure file copying”) simplifies the task reserve
copy a large number of files.
It allows you to copy only the changed files, which gives a significant acceleration during
continuous backup. A file change is determined by its date, size, and attributes.
When copying data from Windows systems to network storage devices (NAS), a situation
may arise that your NAS does not support NTFS file creation time accuracy (100
nanoseconds). This can lead to the fact that identical files will be qualified as different, which
will necessitate copying. The / FFT parameter makes comparing file creation labels with two-
second precision. This may avoid copying duplicate files.

Examples

ROBOCOPY \\\\ Server1 \\ reports \\\\ Server2 \\ backup


Easy copying

ROBOCOPY \\\\ Server1 \\ reports \\\\ Server2 \\ backup *. * / E


Copying with sub-categories

ROBOCOPY C: \\ work / MAX: 33554432 / L


List of all files in the folder that are larger than 32M
GUI for robocopy

Of course, this is not suitable for automation, but it turned out that there is such.

And here is a brief summary:

Traditional copying and pasting features built into Microsoft® Windows® have some
limitations. These functions are quite well suited for simple tasks (moving a document from
one directory to another, etc.), but they lack the additional capabilities that are required by an
IT specialist in the workspace. For example, the copy and paste operation does not provide for
any possibility of reliable recovery, which would ensure the restoration of files in case of a
short network failure. This scheme is based on the principle of “all or nothing,” especially
when copying entire directories. Through the user interface (UI), you cannot select only new
or updated files for copying. You either copy individual files, entire directories, or nothing at
all. Introduction to Robocopy. This powerful tool included in Microsoft Windows server®
2003 Resource Kit Tools, includes all these new features and even more. Robocopy provides
more serious file copying tasks that can really ease your work. The greatest advantage, it
seems to me, will be the possibility for you to create full mirror copies of two file structures
(including all subdirectories and files of your choice) without copying any unnecessary files.
Only new or updated files from their original location will be copied. Robocopy also allows
you to save all relevant file information, including the date and time of the change, access
control lists (ACLs), etc. Microsoft

Which confirms the guess at the outset that it’s like rsync from the Linux world. I use it for
my own. So, you can build a similar script for windows based on robocopy.

To create exact duplicates of all necessary files in the user profile folder (C: \\ Users \\ Your
name) by multi-threaded copying.

Why use Robocopy?

If you are a conscious user, you probably and regularly create an image hard drive and back
up data using the Windows 7 Backup and Restore tool. However, it will not hurt to create
another backup copy, just in case. This can be done manually by dragging the necessary files
to an external hard drive, but if there are too many of them, the process may drag out.

Robocopy utility allows you to use more than eighty command line switches to create an
effective backup script. To make it easier for you, I will explain how to use the capabilities of
the utility to create a mirror copy of all the files in your profile folder (C: \\ Users \\ Your
name).

Team building

As an example, I will compile a command to copy the contents of my user folder “C: \\ Users
\\ Greg Shultz” to the folder “TheBackup” on an external hard drive mounted under the letter
“G” (you, of course, replace the names and addresses with your own). The team will start like
this:
Robocopy “C: \\ Users \\ Greg Shultz” “G: \\ TheBackup”

I want to copy all folders, even empty ones, because they can be useful for future files. At
the same time, I want to exclude from copy files that have already been deleted. You can use
the / S and / PURGE switches for this, but I prefer to use one switch to perform both / MIR
tasks. Now the command looks like this:

Robocopy “C: \\ Users \\ Greg Shultz” “G: \\ TheBackup” / MIR

In the folder "C: \\ Users \\ Greg Shultz" there are several hidden system files and folders
that I do not intend to copy - for example, “NTUSER.DAT” and “AppData”. In addition, there
are several connection points in the profile folder that attach system folders to it - for
example, “Cookies” and “SendTo”.

To exclude hidden system files from copying, I use the / XA: SH switch, and in order not to
copy the AppData folder with all its contents, the / XD switch. Finally, the / XJD switch
eliminates all connection points. As a result, the team now looks like this:

Robocopy “C: \\ Users \\ Greg Shultz” “G: \\ TheBackup” / MIR / XA: SH / XD AppData /
XJD

One of the most useful features of Robocopy is related to how the utility handles open files.
When such a file is found, the program pauses copying and waits until it closes. Every 30
seconds, Robocopy tries to resume copying. By default, there are a million attempts (I'm not
kidding!), But in this case, copying is not destined to end at all, so the number of attempts is
better to reduce.

To do this, use the / R switch, and you can change the interval between attempts using the / W
switch. I will reduce the number of attempts to five, and the time interval between them to 15
seconds. Then Robocopy will be able to resume copying, waiting some time. Now the
command looks like this:

Robocopy “C: \\ Users \\ Greg Shultz” “G: \\ TheBackup” / MIR / XA: SH / XD AppData /
XJD / R: 5 / W: 15

Now you can add a multi-threaded copy switch / MT [: n] to the command, where n is the
number of streams from 1 to 128. You can not specify the value of n, but use the / MT switch
only. In this case, eight threads will be used. I prefer 32 threads. Note that multithreaded
copying is not compatible with the / IPG and / EFSRAW switches. So, the new team:

Robocopy “C: \\ Users \\ Greg Shultz” “G: \\ TheBackup” / MIR / XA: SH / XD AppData /
XJD / R: 5 / W: 15 / MT: 32
Like all command line utilities, Robocopy constantly informs the user about the status of the
operation, but it is much more convenient to save this data in the form of a report. I’ll use
the / V switch to get the full picture, but I don’t need information about the progress of
copying each individual file, so I’ll add the / NP switch to the command. The report file is
created using the / LOG switch and overwritten each time the utility is run next. The final
command looks like this:

Robocopy “C: \\ Users \\ Greg Shultz” “G: \\ TheBackup” / MIR / XA: SH / XD AppData /
XJD / R: 5 / W: 15 / MT: 32 / V / NP /LOG:Backup.log

Script creation and use

Now that you know how to use the switches, put the command you need in Notepad and save
the file as “RobocopyBackup.cmd”. To prevent open script and report files from copying, I
created the folder “C: \\ BackupTool” in the root directory and saved them there.

The report file will be saved to the same directory after each utility launch. Although this is a
simple text file, it may be too voluminous for Notepad, so you should open it in some other
word processor - for example, in Wordpad.

Now, when you need to create an additional backup, simply run the RobocopyBackup.cmd
file by double-clicking, and at the end of the operation examine the report file Backup.log.
With the help, you can program the regular launch of the RobocopyBackup.cmd file on a
schedule.

What do you think?

Do you use robocopy utility in windows 7? What other switches would you add to the backup
command? Share your opinion in the comments!

Note to yourself:

Conscious PC users can certainly create a Vista hard disk image using the Backup PC
(Complete PC Backup) tool in the Backup and Restore Center and regularly use the Windows
backup tool (Windows Backup) to create backup copies of important files.

However, for security, it never hurts to have an extra backup of your data. In principle, you
can get it by simply dragging the Documents folder onto a removable hard drive, but it is a bit
tedious to do this each time manually.

Fortunately, in Microsoft Windows Vista is utility robocopy (The utility is included in the
Windows Resource Kit), greatly facilitating the creation of additional backup copy data. As
many probably know, Robocopy has been included in the Windows Resource Kit service
application package since the days of Windows NT 4.0, but this time Microsoft developers
provided the utility with additional features designed specifically for Vista and decided to
include it in the operating system. The fact that now everyone can use it is simply wonderful,
but there is one “but” here: Robocopy is an application with a command line interface, and
more than eighty switches are provided to control its capabilities.

So, in order to fully use the functions of Robocopy, you will have to spend a lot of time
decoding all these switches and choosing the most suitable for the task. For hardened
technicians, this may not be a problem, but for ordinary users who need only a utility for
additional backups, such difficulties can be frightening.

Recently, I decided to thoroughly examine the command switches. robocopy strings, and as a
result, wrote a simple little script that you can use to create an exact copy of all the data files
in the user profile folder (C: \\ Users \\ Username).

Robocopy features

Judging by the name of the utility, we can assume that it is just a means to copy files (Robust
File Copy - “secure file copying”), but in fact, it is a much more powerful application with
many great features that make it an excellent backup tool data. For example, when re-
backup copying robocopy copies only files that have been changed since the last backup.

If you use an unreliable network connection for backup, you can configure the utility so that it
waits for the restoration of communication or resumes the transfer of files from the place
where it stopped. In addition, Robocopy allows you to save all related data - date and time
stamps, security access control lists (ACL) and much more.

Switches

On any Windows Vista system, the Robocopy.exe file is stored in the \\ Windows \\ System32
directory, so you can run it directly from the command line (Command Prompt). To create a
text file with instructions for the utility that can be viewed in Notepad, you need to execute
the command Robocopy /? \u003e RobocopySwitches.txt.

The documentation file is divided into five sections, which include certain categories of
switches. This well-formatted document, along with my examples, can be used to create your
own Robocopy script. The sections of the help file are called:

Copy Options

File Selection Options

Retry Options

Logging Options

Job Options
Creating a command line script

For example, I'm going to create a script to back up data files from my profile folder “C: \\
Users \\ Greg Shultz” to the TheBackup folder on a removable hard disk labeled “J” (in my
script, of course, you need to replace all the names and ways on your own). My script will
start like this:

Robocopy “C: \\ Users” “d: \\ TheBackup”

I want to create copies of all folders, even empty ones, because they can be useful for saving
certain data types in the future. I don’t intend to copy files deleted from the hard disk. You
could use the / S and / PURGE switches for this, but you can achieve your goals with a single
/ MIR switch. Now my team looks like this:

Robocopy “C: \\ Users” “d: \\ TheBackup” / MIR

The “C: \\ Users” folder contains some hidden system files and folders that I don’t need to
back up at all — for example, the NTUSER.DAT file and the AppData folder.

In addition, a number of connection points are stored in the C: \\ Users folder, which I also do
not need. Vista connection points are used to associate various system folders (such as
Cookies and SendTo) with a user profile folder.

To exclude hidden system files, I use the / XA: SH switch, to exclude the AppData folder -
the / XD AppData switch, and to exclude connection points - the / XJD switch. Now my script
looks like this:

Robocopy “C: \\ Users” “d: \\ TheBackup” / MIR / XA: SH / XD AppData / XJD

One of the features of Robocopy is that when a utility encounters a file that is currently being
used by another program, it stops and waits for the file to be closed in order to continue the
copy operation. Every 30 seconds, Robocopy tries to copy the file again. The default number
of retries is one million (I'm not joking)! In this scenario, backup operations are unlikely to
ever be completed, so the number of retries should be limited to some reasonable number.

The / R switch is used to change the number of retry attempts, and the / W switch is used to
change the interval between retries. I decided to reduce the number of retries to five with an
interval of 15 seconds - then after a reasonable waiting period Robocopy will be able to
continue its work normally:

Robocopy “C: \\ Users” “d: \\ TheBackup” / MIR / XA: SH / XD AppData / XJD / R: 5 / W:


15

Like all command-line utilities, Robocopy informs the user about the status of the operation
right in the command window, but it would be more convenient to store this information in a
log file. I love to have a complete understanding of the operations performed, so I will use the
/ V switch to compile the journal. But I’m hardly going to need information about the
progress of copying each file as a percentage, so I’ll include the / NP switch in the script. To
create a log file, I will use the / LOG switch, which replaces the existing log with a new one
with each subsequent backup. Now my script looks like this:

Robocopy “C: \\ Users” “d: \\ TheBackup” / MIR / XA: SH / XD AppData / XJD / R: 5 / W:


15 / V / NP /LOG:Backup.log

Creating your own script

Now that you know how similar scripts work and which switches are needed for this, you can
open Notepad, enter the command, and save the file as “RobocopyBackup.cmd”. To prevent
the script and the open log file from interfering with the copying process, I created in the root
directory separate folder “BackupTool” (“C: \\ BackupTool”) and saved the script in it.

After each backup operation, the log file will appear in the same folder where the script is
stored. Keep in mind that while the journal is a simple text file, it may be too large for
Notepad, so it’s best to open it in WordPad or another word processor.

Now, to create an additional backup copy of the data, it is enough to double-click on the
shortcut of the RobocopyBackup.cmd file to run the script, and upon completion of the work,
to view the Backup.log file. If you wish, you can schedule automatic script execution using
the Task Scheduler (Task Scheduler) or cron

Es gibt dazu auch eine GUI ......

MKSBackup is a free front-end for common backup tools like it Windows wbadmin, Un *
x tools like it to backup Virtual Machine on VMware ESX (i) host.

MKSBackup is developed in Python and is available for Microsoft Windows, Linux and
other Un * x systems.

Applicable to: Windows Server 2008, Windows Server 2003 R2, Windows Server 2008 R2,
Windows Server 2012 R2, Windows Server 2012

This section explains how to use the Robocopy.exe command-line tool to populate files when
setting up replication for distributed file system (DFS) replication (also known as DFSR or
DFS-R) in Windows Server. Preseeding files before setting up DFS replication, Adding a
new replication partner, or replacing a server, you can speed up the initial synchronization
process and enable cloning of the DFS replication database in Windows Server 2012 R2. The
Robocopy method is one of the ways of preseeding; For general information, see.

The Robocopy command-line utility (reliable file copying) is included with Windows Server
2012 R2, Windows Server 2012, Windows Server 2008 R2, and Windows Server 2008. The
program provides advanced features including security copying, backup API support, retry
capabilities and logging. More later versions support multithreading without I / O buffering.
Important

Robocopy exclusively locked files are not copied. If users frequently block many files on
the file servers, it is recommended to use another preseeding method. Preseeding is not
required to fully match each other between the file lists on the source and destination servers,
but it has additional files that do not exist when performing the initial synchronization for
DFS replication, less efficient preseeding. To minimize blocking conflicts, use the
Robocopy command during off-peak hours for your organization. Always in the Robocopy
logs after preseeding to understand which files were missed due to exclusive locks.

Preseeding files for DFS replication with using robocopy includes the following steps:

Before using Robocopy to fill in the files, you must download and install the latest version of
Robocopy.exe. This ensures that the DFS Replication service does not skip files due to
problems with the delivery version of Robocopy.

Source for latest version compatible Robocopy depends on the version of Windows Server
that is running on the server. Information about how to download the hotfix with the latest
version of Robocopy for Windows Server 2008 R2 or Windows Server 2008 in section
968429 in the Microsoft Knowledge Base.

Additionally, you can find and install the latest patches for your operating system by
following these steps.

To find and install the latest version of Robocopy for a specific version of Windows
Server

AT Search supportenter the following line, replacing<operating system


versions\u003e with appropriate operating system and press enter:

robocopy.exe kbqfe " "

For example, enter robocopy.exe kbqfe "Windows Server 2008 R2".

Find and download the hotfix with the highest id number (that is, the latest version).

Install the hotfix on the server.

After installing the latest versions of Robocopy on the server, you should minimize the
chance that blocked files will block copying using the methods in the following table. Most
applications are not solely file locking. However, during normal operation, a small
percentage of the files may be blocked on file servers.
Lock source Explanation Elimination

Perform only Robocopy operations during low


load, non-working time. This minimizes the
number of files that Robocopy must skip during
preseeding.

It is recommended that you temporarily set read-


only access to file shares that will be replicated
using Windows PowerShell Grant-
SmbShareAccessand Close-
SmbSessioncmdlets. If you set permissions for a
common group, for example, all and those that pass
the check for reading, ordinary users may be able to
open files with exclusive locking (if their
Employees connect to the applications determine read-only access when
server standard file and opening files).
edit documents,
multimedia content or You can also accept a temporary firewall rule for
Remote users other files. Sometimes SMB port 445 incoming connections to this server
open files in referred to as traditional to block access to files or use Block-
public home folder or shared SmbShareAccesscmdlet However, both methods
folders. data workloads. are very disturbing user operations.

Temporarily disable or remove applications that


block files. Process Monitor or Process Explorer
can be used to identify applications that block
files.Get-DfsrFileHash in Windows PowerShell
Applications Applications workloads or Dfsrdiagcommand to check the preseeded files
open local on the file server by comparing the hash code on the source and
files. sometimes lock files. destination servers. For instructions, see.

Every Wintel administrator is familiar with the Robocopy utility. Since the days of Windows
NT4, it has been included in the Resource Kit, and since Windows Vista it has been included
in the operating system.
Why do you need Robocopy? In order to copy files. Lots of files. We mainly use it to
migrate file servers or backups.
There are many interesting options for migrating file servers, for example, using DFS-R. But
there is nothing easier and safer to run.

Robocopy \\\\ SERV \\ D $ F: \\ / e / copyall / zb / mt: 8 / r: 1 / W: 5 / V / TS / FP / ETA / TEE


/LOG:c:\\temp\\robocopy.txt
In the final, you can close user access to the resource and create an incremental copy by
adding the / MIR key.
But is Robocopy so good?? Is it good enough to entrust the migration of the most important
files to it?

One fine Saturday afternoon, I migrated a file server. There were no employees at work. The
first copy was made yesterday, it remained only to make an increment and update the links in
DFS.
I launched Robocopy, looked at the log, and for reinsurance, before switching, I decided to
see how many files and folders in the source and destination file resource. The numbers do
not converge. Suddenly.
But why? I saw this result for the first time. Did I do something wrong? Someone from the
staff still changed the files while incremental copying was going on? Key / MIR failed? Any
files missing? Empty? With Access Denied? Damaged?

Well, disable network access and copy files again. Does not converge! We try without / MIR.
The same result.
I was at a loss. For fifteen years I trusted Robocopy 100%, and today, for the first time, it
failed. Some files are simply not in the destination! It's just impossible to believe it.

Let's count the files differently. Download the FileList utility and list the files in the source
and destination folders. And here the number of files coincided. Amazing.

And what if it's not Robocopy? What if Windows Explorer counts wrong? Maybe in
Windows Server 2008 R2 bad Explorer, and in Windows Server 2012 R2 good? I opened the
local and target folder properties on the source Windows Server 2008 R2 server. The number
of files did not match. We hope that everything is fixed in Windows Server 2012 R2. Open
the folder properties on the new server ... And ...
Not only the number of files in the source and destination folders did not match. The number
of files was different from those shot on Windows Server 2008 R2. Black street magic.

And at that moment (finally) an epiphany fell upon me. It's not about Robocopy, and not
about versions of explorer. Just Explorer can not (!) Count, and does not consider files and
folders with names longer than 260 characters.

On the source server, the files were located along the path “F: \\ Office1”. On the new - "U: \\
SharedFiles \\ Office1".
Just because of the “SharedFiles” subfolder, the names of some files and folders have
become longer than 255 characters. For Robocopy, it was easy to copy them. FileList easily
calculated them. And only Explorer missed such files when counting.

By making subst N: U: \\ SharedFiles and counting the number of files in F: \\ Office1 on the
source server and N: \\ Office1 on the target, the number of files coincided.

Robocopy can be trusted.

UPD: As correctly corrected in the comments, yet not 255, but 260 characters.
256 - directly file name "file.txt"
3 - "C: \\"
1 - invisible null at the end
Thank!

Robocopy: Best practices for working with this helpful


Windows utility
As someone who grew up using the old DOS “copy” command, copy is often my go to when I
only need to copy a few files. However, Windows includes another file copy utility called
Robocopy. Robocopy is far superior to the old copy command, and is well-suited to the task
of performing large or complex file copy operations.

As useful as Robocopy may be, however, it can be a bit complicated to use. Entering the
Robocopy /? command reveals dozens of command line switches. If you don’t use Robocopy
on a regular basis, it can sometimes be tough to figure out which switches are best suited to
completing the task at hand. That being the case, I wanted to take the opportunity to explain
the switches that I tend to use the most often. Keep in mind that this is by no means intended
to be a comprehensive discussion of the available command line switches, but rather a
discussion of some of the ones that I find to be most useful.
Copying file attributes
The Robocopy utility includes a /COPY switch that allows you to specify exactly which parts
of the file you want to copy. This gives you a way of making sure that the copied data retains
the original date and time stamp, security permissions, and that sort of thing.

When you use the /COPY switch, you are required to specify one or more flags that tell
Robocopy what to copy. Those flags are:

D – Data
A – Attributes
T – Timestamps
S – NTFS ACL Security
O – Owner
U – Auditing information

The nice thing about having so many flags available to you is that it allows for very granular
control over the copy process. The disadvantage however, is that it can be tedious to have to
use so many different flags. Thankfully, there are some shortcuts available.

If you want to make sure that you retain the most commonly used components (Data,
Attributes, Timestamp, and Security), you can use the /SEC switch. It does exactly the same
thing as using /COPY:DATS

If you are like me and want to retain all of the file’s various attributes, then you can use the
/COPYALL switch instead. This is the equivalent to using /COPY:DATSOU
Subdirectories
Shutterstock

If you are going to be copying a group of files, then there is a good chance that you will also
need to copy any subdirectories that may be present. You can tell Robocopy to copy these
subdirectories by including the /S switch. However, I recommend using the /E switch instead.

The difference between these two switches is that if you use the /S switch, then Robocopy
will only copy subdirectories containing data, but will ignore any empty subdirectories. While
that may be fine in some situations, my philosophy has always been that even if a
subdirectory is empty, there is a reason why it exists. Perhaps an application occasionally
looks to that subdirectory to see whether or not a particular file exists. Using the /E switch
instead of the /S switch ensures that the resulting copy will have a directory structure that
perfectly mimics that of the original data.

Preventing errors

Microsoft
It’s no fun to start a large copy operation, and then come back a few hours later to discover
that the operation has failed for some reason and that you have to start over again.
Fortunately, Robocopy provides some tools for avoiding these frustrating situations.

The first of these options is something called Restartable Mode. Restartable Mode can be
enabled using the /Z switch, and is well suited to situations in which you need to copy large
files over a potentially unreliable network. If the file transfer fails, then Restartable Mode
allows the transfer to be resumed from the point of failure, rather than requiring it to be
restarted from the beginning.

A second option is to use Backup Mode. Backup Mode can be enabled by using the /B switch,
and is useful for overcoming permissions related errors. If you are copying user data, then
there is a chance that you might not have permission to access all of the user’s files.
Normally, this would cause the file copy process to fail.

Backup Mode overcomes this problem by treating the file copy process as a backup operation,
essentially ignoring any permissions related issues. In order to use Backup Mode however,
you do have to be using Robocopy from within an administrative command prompt and you
need to have backup privileges.

The Restartable Mode and the Backup Mode options are mutually exclusive, which means
that you can choose to use one or the other, but not both. Even so, there is a way to get the
best of both worlds. Rather than using the /Z switch or the /B switch, use /ZB instead. This
tells Robocopy to use Restartable Mode, but to switch to Backup Mode if it encounters a
permissions problems.
While I am on the subject of error prevention, I want to quickly mention the /TIMEFIX and
/SECFIX switches. These switches tell Robocopy to fix time errors and security errors on
files. Robocopy can even fix these errors on files that it skips.

Performance

One last thing that I wanted to mention is that there is Robocopy includes a switch that you
may be able to use to decrease the amount of time that the copy process takes to complete.
The switch is called /MT, and it is used to specify the number of threads used by the copy
process. By default, Robocopy distributes the copy process across eight threads, but you can
increase the thread count to as much as 128.

Obviously, increasing the thread count won’t help in every situation. If the storage device is
running at its maximum I/O capacity for instance, then using extra threads isn’t going to do
anything to improve performance. In some cases though, using extra threads can help.

Robocopy: A lot of uses

While it is easy to think of Robocopy as a tool for copying files from Point A to Point B, it
can also be used for migrations. Robocopy has the ability for example, to monitor a source for
changes and then replicate those changes to a destination. While there are admittedly some
third-party tools that really take the copy process to the next level, Robocopy is an excellent
choice if you want to stick to using native tools.

ROBOCOPY /MIR not working like I think it should.


So in my source I have non-empty folders A, B, and C.

In my destination I have non-empty folders, A, B, C, D, and E.

If I use ROBOCOPY source dest /MIR, I would assume that directories D and E in the destination
would be removed since they are not present in the source. However, the folders are not deleted, and
neither are the files in them.

Am I reading how /MIR works incorrectly?

This is ROBOCOPY on Windows 10 Enterprise 1709.

*I think you are right. The /MIR option says that /MIR is equivalent to /E and /PURGE, and /PURGE is
supposed to "delete dest files/dirs that no longer exist in source".

I have no idea why it isn't working correctly.

In my ROBOCOPY backup scripts, I use /E /MIR and /PURGE all at once. Seems to work right as far
as I know.

*Is this happening over SMB or is it strictly local?


If SMB, check share permissions.
In either case, check NTFS permissions on the folder you think should be getting removed as well as
on subfolders/files and the parent folder, as well. If permission is denied on any subfolder/file, the
folder won't go away.
Also, is the not-deleted folder a normal folder or is it an NTFS reparse point of any kind (junction, hard
link, soft link, NTFS mount)?
Also be sure there are no open file handles on anything in that folder, including the folder itself. This
includes being in that path in a command prompt or any remote mounts.

You could also add a "/V /FP" to your robocopy command to see if it's even touching it and hopefully, if
it is, see why it's not deleting it.

It's not part of a DFS/FRS volume, is it?

Just the thoughts that come to mind, if you haven't already done all that.

Robocopy script to synchronize folders


Requirements:

 If a file is deleted in source, remove it from destination as well.


 If a file is deleted form destination, do not remove from source.
 if a file is already in source and destination do not do anything
 if a file is on source but not destination, copy to destination
robocopy "\\source" "destination" /r:60 /w:5 /PURGE
/MIR /MT:64

r:60 – retry 60 times

w:5 wait 5 seconds between retries

/PURGE: delete from destination if file is not in source

/MIR MIRror a directory tree

/Z : copy files in restartable mode

If we use /Z (restartable mode) the transfer bandwidth is about 4 to 6Mbps.

If we take off the /Z switch, it goes between 80-120Mbs

and we need to add /MT:64

/MT[:n] :: Do multi-threaded copies with n threads (default 8).

This way the “file in use” error should be eliminated since Robocopy will
have enough time between the scheduled run times to copy even the
largest files ~6GB

Uh Oh! Robocopy gone wrong


Several years ago, we enabled DFS on a file server, and it reported several files as corrupted.
The files could not be copied, backed up, or even deleted without an error. These files were
housed in an elaborate folder structure dating back several years. We wanted to retain the files
in a effort to repair them at a later point. I decided to move the entire folder to a temporary
location on the same drive and then use the Robocopy command to copy the good data back
to the original location.

I created a robocopy script to move all from the temp location to the original location. If all
worked well, the temp location would contain all the corrupt files, while the original location
would contain all of the good files.

This is a small portion of the script I wrote.

ROBOCOPY *.* “E:\Temp\Corrupt Files” “E:\Users” /COPYALL /MIR /MOVE

I added other options that allowed me to create a log file and view the progress on a console
window.
I executed the command and noticed the screen was displaying "EXTRA File" and just kept
repeating that same line for quite a while. I had never really seen that before. I noticed it was
listing several User folders before the folder I wanted to restore. I didn’t think much of it and
let it go on. After several minutes, I looked at the Explorer view of the E:\Users folder to see
what type of progress it was making, and I noticed that a few user folders had disappeared. I
immediately forced a stop to the script.

I looked at the log file I had created and noticed that all of the files stating "EXTRA File"
were in the User folders that had disappeared. My robocopy script was doing what I asked it
to do. By using the /MIR command, It was mirroring what was located in E:\Temp\Corrupt
Files with what was in E:\Users. Big mistake: I had inadvertently deleted several user folders.
Luckily, I caught it soon enough, and I was able to restore the deleted folders quickly. And it
was a weekend, so no one really noticed anything. But I knew I had made a bad mistake that
could have been a lot worse.

My main takeaway: The mirror command (/MIR) is a powerful command that mirrors a
directory tree. When using this command, examine the relative paths in the Robocopy
command. Be very aware of the destination folder. If it contains content that you want to
retain, make sure the source also includes the same structure or it will be considered as an
EXTRA File and deleted. Not good.

The corrected portion of the robocopy statement is:

ROBOCOPY *.* “E:\Temp\Corrupt Files\JDOE” “E:\Users\JDOE” /COPYALL /MIR


/MOVE

In this example, only the contents of the folder “E:\Temp\Corrupt Files\JDOE” will be moved
to the folder “E:\Users\JDOE”. No other files or folders outside of JDOE will be affected.

Even after all these years, I still get nervous whenever I see "EXTRA File" displayed on the
console window.

How to pause Robocopy.exe


If you need pause some proces like me – in my case it was robocopy.exe i
recomending use the PsSuspend tool from Sysinternals – pause robocopy.exe
without killing it !

download PSSuspend for free here

PS C:\Users\administrator.XXX\Desktop\PSTools> .\pssuspend.exe robocopy.exe

PsSuspend v1.07 - Process Suspender


Copyright (C) 2001-2016 Mark Russinovich

Sysinternals

Process robocopy.exe suspended.

If you need pause process (in my case it was robocopy.exe)

PS C:\Users\administrator.XXX\Desktop\PSTools> .\pssuspend.exe robocopy.exe -r

PsSuspend v1.07 - Process Suspender

Copyright (C) 2001-2016 Mark Russinovich

Sysinternals

Process robocopy.exe resumed.

Taming Robocopy - The Silicon Underground


A prolific commenter mentioned yesterday how much he dislikes Robocopy. Perhaps worse
than I dislike Windows 7. And the nightmare scenario he describes sounds plausible. I’ve
trashed directories with errant copy and xcopy commands, and I know I’m not the only one.
And those are comparatively very simple.

I suppose one could put training wheels on a tool like Robocopy, but to me, that defeats much
of its purpose. When I play the Robocopy card, it’s generally because I have a copy task that
potentially will take several hours–if not days–and it’s going to run into errors, and I want it
to just do the best it can, without asking me any questions, so I can walk away and let it chew
on the problem for however long it takes.

I won’t say Robocopy is one of those things that can make or break a career, but it’s certainly
allowed me to swoop in and save the day on several occasions, and that’s always good. So
here’s how.

Rule #1: Give yourself time to test

Never let yourself get into the situation where you’re running Robocopy in a hurry. If
someone’s breathing down your neck to get it done, point out that you’re using a tool that can
delete just as easily as it copies, and the more distracted you are, the more likely you are to
make a mistake.

Also point out that once this thing actually starts working, it’s just about the fastest and most
reliable way to get the job done because if it gets interrupted, you can run it again and it’ll
pick right back up where it left off.

Rule #2: Use a batch file

When I’m developing a procedure using Robocopy, I rarely type it straight into a command
line. The command has nearly 90 switches for you to keep straight. Some of them are
extremely dangerous, like /MIR and /PURGE, because they delete files as well as copying
them.

Typically I only use more like six of them, but even six switches is enough to be obnoxious.
So I put the command in a batch file, framed by pause commands. Like so:

rem scarycopy.bat
pause
robocopy c:\here c:\there *.* /e /z
pause

The first pause command is so that if I accidentally run it, I can hit ctrl-c to stop it. The
second pause is so that I can see what it actually did when it finishes.

You can even add another REM line telling what the arguments are intended to do. It helps to
refresh your memory. Or to explain your intent to any coworkers who might examine the file.

The other thing I’ve noticed is that I rarely use Robocopy in a particular way just once.
Usually when I use it, it’s not long before someone wants me to do it again. If I have a batch
file, then when I need to do the same thing again next month or next quarter, I can just run it
again. Maybe with revisions, maybe without.

As an aside, one of my coworkers says you don’t want to hire the sysadmin who’s running
around with his hair on fire all the time. You want the one who lounges around with his feet
up on his desk and looks like he never does anything, because that’s the guy who has his
whole job automated and he isn’t causing new problems, and he has time to solve problems
when they occur naturally. He’s onto something with that thought.

Rule #3: Be explicit

Just to keep my head clear about what I’m doing, I always specify full paths and filespecs.
Even when the default behavior is what I want. Better safe than sorry.

Specifying full paths and filespecs also helps keep me from putting switches in the wrong
place and causing Robocopy to behave differently from how I want.
Rule #4: Stage and test

The next thing I do is stage a test run. I make a copy of a bunch of data, so I have something I
don’t care about to test with. I copy it somewhere. Then re-read the documentation, double-
check my Robocopy command in my batch file, and then I add a /L switch.Then I run it. That
tells it to list what it’s going to do, but not actually do it. Once I’m confident, I’ll go back,
remove the /L switch and run it again for real, on practice data. Periodically, I’ll add and
remove the /L switch several times as I develop a solution.

Look at it like a power tool.What happens if I just grab my jigsaw and start cutting? One of
two things. I hurt myself, or I end up with something that looks like I cut it with a can opener.
So I clamp the work piece onto my workbench, measure, line up my straight edge and clamp
that into place, measure again in case anything slipped, and then I’m finally ready to cut. I’m
no carpenter, so the results still may not look professional, but they look a lot better if I do the
prep work.

Yes, it’s a lot of prep work, but if you’re using Robocopy for something important–in the past
I’ve usually used it to copy entire file servers to new machines, or to stage system builds
hundreds or thousands of miles away–it’s worth making sure you got it right. Unless
you like rebuilding servers (and your boss likes you rebuilding servers).

Rule #5: Examine the results, then repeat until it’s right

There’s not a lot to be said about this. Open the destination directory and see what the
command did. If it worked, that’s great. If it didn’t work, re-read the documentation and see
what went wrong. It’s test data, right? There’s no shame in having to do it again.

Rule #6: Revise for the real world

Once you’re confident that it worked, go back to the file and change your test directories into
the actual directories or UNCs that you’ll be using in the real world.

Ideally, now you can walk away. Let your head clear, and take a look at it again in the
morning (or at least in an hour) and see if it still makes sense. Then run it.

Related stories by Dave Farquhar


XCOPY vs ROBOCOPY

XCOPY vs ROBOCOPY: Which do you like? If you're a command line jockey, both
Windows tools have their place. Here's how I decide when to use which one. Note: If you're
looking for a comparison of Robocopy and the third-party freemium tool Xxcopy, see this
post. History In the beginning…

Is there something better than Robocopy?

Here's a question I hear quite a bit: Is there something better than Robocopy? If you're looking
for alternatives to robocopy, read on. I immediately thought of Xxcopy. Depending on your
perspective, it could be better. So-named because it's an extension of Xcopy, which was itself
an extension of copy,…

Xxcopy vs Robocopy

Part of being a system administrator is copying large quantities of files around, for any
number of reasons. The traditional command line tools for this, Copy and Xcopy, have some
limitations. For this reason, two companies extended Xcopy: Microsoft, with Robocopy, and
Pixelab, with Xxcopy. Let's compare Xxcopy vs Robocopy.…

Robocopy Complete Reference

Introduction
RoboCopy (Robust File Copy) is a command-line tool in Windows . It is intended for consistent copying or mirroring
of directories wherever the computer has access, including local drives, removable drives, Local Area Network,
remote servers, and in the process guarantees that all file properties and permissions stays integral.
This article deals about the Robocopy Command-line tool with Examples and Switches.

Syntax Examples:
robocopy source destination [file [file] ... ] [parameters]

 source: specifies source folder. You can use drive:\path or \\server\share\path here.
 destination: specifies destination folder. You can use drive:\path or \\server\share\path here.
 file: Files to process. Wildcard characters are supported (* match any sequence of characters, ? : match a
single character)
 parameters: Command-line switches you wish to use. You can find the entire list at the end of this
document.

Copy Folder
The most simple operation with robocopy is copying sources folders to the destination
In this example, we will copy the directory C:\Temp to the destination folder E:\Temp

robocopy “C:\Temp“ “E:\Temp“


After copy operation, some data are provided by robocopy

· Start shows start time of copy operation


· Source shows source directory
· Dest shows destination directory
· Files shows file filter
· Options shows given options
· Total shows total files and folders count
· Copied shows copied files and folders count
· Skipped shows not copied files and folders

Copy a file to remote system or share


Similarly we can copy files and folders to the remote system. We will provide remote system’s hostname or IP
address before the destination path. We can use \\server1\share or \\10.0.2.9 to specify remote system.
In this example we will copy source directory named C:\Temp to the remote system with IP address 10.0.2.9 under
the path share with the named TempShare.

robocopy “C:\Temp” \\10.0.2.9\share\TempShare

Copy files of specific extension


robocopy provides some filtering features while copying files. We can specify the filenames and extensions we want
to copy. This will skip other file named and extensions. We will provide the file name or extension after the
destination folder.
In this example, we only want to copy *.txt extension files.
robocopy "C:\Temp" "E:\Temp" *.txt

Copy subfolders
By default, only first level directories are copied to the destination. If we want to copy all directories and
subdirectories ,folders we should enable /S switch.
robocopy “C:\Temp” “E:\Temp” /S

List Files
This is a very useful feature for robocopy where source files are not copied and just listed. This feature can be
valuable if we want to check current files and folders. We can use /L option for print list of files and directories.
robocopy “C:\Temp” “E:\Temp” /L
As we can see from the output that all files and folders are skipped and not copied.

List Files recursively


While robocopy is primarily used to copy files from remote to local or local to remove we can use /L and /S choices
in order to

list remote files. We can merge two options list and recursive to list all level files and folders.
robocopy “C:\Temp” “E:\Temp” /L /S
Copy Files Lesser than specified Size
While copying files we can state the size of files we want to copy. In this example we will copy files those sizes are
lower than 1K

. We will use /MAX option for this.


robocopy “C:\Temp” “E:\Temp” /S /MAX:1000
Copy Files greater than specified Size
To do so we can use switch /MIN . This will only copy files higher than given size.
In this example we will copy files higher than 1K which is 1000 kilobyte.
robocopy “C:\Temp” “E:\Temp” /S /MIN:1000
Move Files
The default behavior of robocopy is copying files. Occasionally we may have to move files. This can be done with
robocopy too. We will provide /MOV option in order to move files and folders.
robocopy “C:\Temp” “E:\Temp” /S /MOVE

Get the logs of robocopy operation


While doing copy and move operations we can also need some logs, especially in bulk data operations. We can
write log about specified operations with /LOG option. We can also specify the log file name y adding at the end of
/LOG option. In this example, we will write robocopy operation log to log file named backup.log . This will prevent
regular output

robocopy “C:\Temp” “E:\Temp” /S /LOG:backup.log

The log file can be listed with type command in MS-DOS command line like below.
type backup.log.Alternatively you can also open the log file in notepad
Copy specified File Properties
Files and folders could have different properties. These properties can be used for different purposes like the listing
owner, audit information, timestamps etc. We can copy these attributes too with the robocopy command. Here is
the attributed we can specify for the copy. We will also use /copy: option by adding the property we want to copy.
· D is used to copy data properties
· A used for attributes
· T for time stamps
· S is used for NTFS access control list simply ACL
· is used for the owner information
· U is used for Auditing information

In this example, we will copy time stamp attributes or properties with the following command.
robocopy “C:\Temp” “E:\Temp” /S /copy:T
Copy All Attributes with /copyall
We can also copy files with all properties of attributes with the /copyall parameter like below. This is equal to
the /copy:DATSOU.
robocopy “C:\Temp” “E:\Temp” /S /copyall
Delete or Remove Destination Files and Directories That No Longer Exist In The
Source
If we are trying to make an identical copy of the local files and directories to the remote we need to purge or
remove remote files and directories that no longer exist in the source. We can use /purge option for this.
robocopy “C:\Temp” “E:\Temp” /purge

Robocopy Switches
Copy options:
/S : Copy sub-folders.
/E : Copy sub-folders, including empty sub-folders.
/Z : Copy files with resume support.
/B : Copy files in Backup mode.
/SL: Copy symbolic links instead of the target.
/ZB : Copy files using resume support; if access denied use Backup mode.
/EFSRAW : Copy encrypted files using EFS RAW mode.
/LEV:n : Copy only top n levels of the source folder tree.
/DCOPY:T : Copy Folder Timestamps.
/COPY:copyflag[s] : Specifiy what file information to copy. Copyflags:
D=Data, A=Attributes, T=Timestamps, S=Security=NTFS ACLs, O=Owner info,
U=Auditing info.
/COPYALL : Copy all file information.
/NOCOPY : Copy no file information.
/SECFIX : Fix all files security.
/TIMFIX : Fix all files time.
/PURGE : Delete destination files/folders that no longer exist in source.
/MIR : Mirror folder structure.
/MOV : Move files.
/MOVE : Move files and folders.
/A+:[RASHCNET] : Add attributes to destination files.
/A-:[RASHCNET] : Remove attributes from destination files.
/CREATE : Create folder structures and zero-length files only.
/FAT : Create destination files using 8.3 FAT file names only.
/256 : Disable very long path (> 256 characters support).
/MON:n : Monitor source, and run again when more than n changes seen.
/MOT:m : Monitor source; and run again in m minutes Time, if changed.
/RH:hhmm-hhmm : Run Hours - times when new copies may be started.
/PF : Check run hours on a Per File basis.
/IPG:n : Inter-Packet Gap (ms) to free bandwidth on slow lines.

File Selection Options:


/A : Files with Archive attribute set.
/M : Files with the Archive attribute and remove it.
/IA:[RASHCNETO] : Include files with specific attributes set.
/XA:[RASHCNETO] : Exclude files with specific attributes set.
/XF file [file]... : Exclude Files matching given names/paths/wildcards.
/XD dirs [dirs]... : Exclude folders matching given names/paths.
/XC : Exclude Changed files.
/XN : Exclude Newer files.
/XO : Exclude Older files.
/XX : Exclude extra files present in destination folder but not in source.
This will prevent deletion of existing files in destination folder.
/XL : Exclude files and folders present in source but not destination. This
switch will prevent new files being added to the destination
/IS : Overwrite existing files even if they are same.
/IT : Include files with identical size and timestamp, but different
attribute settings.
/MAX:n : Exclude files bigger than n bytes.
/MIN:n : Exclude files smaller than n bytes.
/MAXAGE:n : Exclude files older than n days/date.
/MINAGE:n : Exclude files newer than n days/date.
/MAXLAD:n : Exclude files unused since n days.
/MINLAD:n : Exclude files used since n days.
/XJ : Exclude Junction points
/FFT : FAT File Times (2-second granularity.
/DST : Compensate for one-hour DST time differences.
/XJD : Exclude Junction points for Folders.
/XJF : Exclude Junction points for Files.

Retry Options:
/R:n : Number of Retries on failed copies: default 1 million.
/W:n : Wait n time between retries: default is 30 seconds.
/TBD : Wait for sharenames to be defined.

Logging Options:
/L : List only.
/X : Report all extra files.
/V : Verbose output.
/TS : Include source file Time Stamps.
/FP : Include Full Pathname of files.
/BYTES : Print file sizes as bytes.
/NS : Don't log file sizes.
/NC : Don't log file classes.
/NFL : Don't log file names.
/NDL : Don't log folder names.
/NP : Don't show progress of operation.
/ETA : Show Estimated Time of Arrival of copied files.
/LOG:file : Output status to a LOG file. Overwrite existing file
/LOG+:file : Append existing output status to an existing LOG file.
/UNILOG:file : Output status to a Unicode LOG file. Overwrite existing file
/UNILOG+:file : Append existing output status to an existing Unicode LOG
file.
/TEE : Output to console window and log file.
/NJH : Don't output Job Header.
/NJS : Don't output Job Summary.

Pause Robocopy :
check with PsSupend to pause the process without killing it http://technet.microsoft.com/en-
us/sysinternals/bb897540(en-us).aspx

Job Options:
/JOB:jobname : Take parameters from specified job file.
/SAVE:jobname : Save parameters to a specific job file.
/QUIT : QUIT after processing.
/NOSD : NO Source Folder is specified.
/NODD : NO Destination Folder is specified.
/IF : Include the following Files.

How to Clean Folder Contents when a Filename or File Path is


to long
Last update: June 05, 2019 09:21. Author: Christian Stokes .

When cleaning files from a Windows Operating System (OS), you are halted with errors
relating to the filename or the file path being too long. This is due to a 255/260 character limit
on Windows Operating Systems preventing the files in a directory from being removed.

Follow this article to learn how to remove all files from a directory that have a longer than
allowed filenames or paths by using the Microsoft utility "Robust File Copy" (Robocopy).

Symptoms

 Source Path Too Long


 The source file name(s) are larger than is supported by the file system.
How to Solve the Issue

The actions performed in the below process will permanently remove all contents, such as
files and folders, in your specified path.

Using Robocopy to delete files that have a path and filename that is too long:

1. Notate the folder directory path that needs its contents to be deleted.
o Example: C:\FolderToBeCleaned

2. From Windows File Explorer, create an empty folder anywhere on the hard drive:
o Example: C:\EmptyFolder
3. Open a Windows Command Prompt as an Administrator.
4. Type the following command, replacing the example paths with yours:
o Robocopy C:\EmptyFolder C:\FolderToBeCleaned /purge

5. Press the Enter key.

The folder contents are now deleted:

Was this article helpful?


18 out of 22 found this helpful
How to delete all files in a directory with RoboCopy
You know that dreaded “calculating time remaining” window, wherein you are trying to
delete all the files in a folder and the operating system is simply wasting time trying to count
the files within as well as estimate the time required to delete it all?

I know it all too well. It can present a problem when trying to quickly free up space or
otherwise work efficiently. So naturally, I had to figure something else out when purging
masses of data.

Bonus: This method also bypasses any limitation in how long the path/filename can be when
trying to delete through Windows Explorer.

Here’s some information about RoboCopy and this scenario:


Syntax

robocopy <Source> <Destination> [<File>[ ...]] [<Options>]

Parameters
Parameter Description
<Source> Specifies the path to the source directory.
<Destination> Specifies the path to the destination directory.
Specifies the file or files to be copied. You can use wildcard characters
(* or ?), if you want. If the File parameter is not specified, *.* is used as the
<File> default value.
<Options> Specifies options to be used with the robocopy command.
Options for this use-case
/purge Deletes destination files and directories that no longer exist in the source.
/mir Mirrors a directory tree (equivalent to /e plus /purge).
Remarks

 The /mir option is equivalent to the /e plus /purge options with one small difference
in behavior:
o With the /e plus /purge options, if the destination directory exists, the
destination directory security settings are not overwritten.
o With the /mir option, if the destination directory exists, the destination
directory security settings are overwritten.

How to empty entire directory contents

Create an empty directory such as C:\empty

In this scenario, the folder we would like to empty out is C:\test

After creating the empty directory, you are ready to erase all the contents of your desired
directory like so:

robocopy c:\empty c:\test /purge


or
robocopy c:\empty c:\test /MIR
* the difference between these two methods will vary only slightly, and will result in
something unexpected if you are trying to preserve security permissions on the original
directory. Please refer to the above “Remarks” section.
Since the source directory (C:\empty) is lacking any contents, when Robocopy tries to mirror
it, or when robocopy uses it as a purge reference, it simply deletes the contents of the target
directory (C:\test)
How to use Robocopy to transfer files super-fast over the
network on Windows 10 • Pureinfotech
Windows 10 has a hidden tool called Robocopy to copy files very fast between computers
over the network — Here's how to use it.

After setting up Windows 10, you may still need to transfer all your files to the new device.
Usually, you just use an external hard drive to copy your files and move it over the new
device. Or if you’re a tech-savvy user, you probably transfer the files over the network to the
new PC setting up file share.

While these are all good options, depending on the amount of data you need to transfer, using
File Explorer, the process can take a very long time. If you want to copy (migrate) a lot of
files faster and more reliably, you need a better solution, such as Robocopy.

Robocopy (Robust File Copy) is a command-line tool built into Windows 10, but it’s been
around for years, and it’s a powerful and flexible tool to migrate files extremely fast.

In this guide, you’ll learn the steps to use Robocopy to quickly transfer a lot of files over the
network on Windows 10.
How to use Robocopy to copy files over the network fast

The features included with Robocopy allows you to copy files very quickly, but remember
that you’ll need a wired connection for the best experience. The time that will take to
complete the transfer will depend on the network connection speed and disks performance.

This is a two-step process. You must first configure file sharing on the source device, and
then use Robocopy in the destination device to perform the transfer.

Configuring file sharing on Windows 10

In order to copy files between two computers, you must enable file sharing in the source
device, so that Robocopy can access and copy the files from the destination device.

To share files on your local network using the express settings, use these steps:

1. Open File Explorer.

2. Navigate to the folder you want to share.

3. Right-click the item, and select Properties.


Folder Properties option

4. On the “Properties” window, click the Sharing tab.

5. Click the Share button.


Folder Sharing tab

6. Use the drop-down menu to select the user or group to share file or folder. For the
purpose of this guide, select the Everyone group.

7. Click the Add button.


Choose people to share with

8. Under “Permission Level,” select the type of sharing permissions you want the folder
to have. For example, you can select Read (default) if you only want users to be able
to view and open files. If you select Read/Write, users can view, open, modify, and
delete the content on the folder you’re sharing.

9. Click the Share button.


Share permission level

10. Note the network path for the folder that other users will need to access the content
over the network and click the Done button.

11. Click the Close button.


Shared folder path

After completing the steps, make note to of the folder path and the IP address of your source
computer.

Quick Tip: You can quickly find out your IP address on Settings > Network & Internet,
click Wi-Fi or Ethernet, and click the connection to view the information.
Using Robocopy to quickly copy a lot of files on Windows 10

Once file sharing is configured on the source device, you can proceed copying the files using
Robocopy from the destination device.

To use Robocopy to copy files fast on Windows 10, use these steps:

1. Open Start.

2. Search for Command Prompt, right-click the result, and select Run as
administrator.

3. Type the following command to copy the files over the network and press Enter:

robocopy \\source-device-ip\path\to\share\folder C:\destination-


device\path\to\store\files /S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16
Example:

robocopy \\10.1.2.111\Users\admin\Documents C:\Users\admin\Documents


/S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16

Robocopy Command Prompt

In the above command make sure to change the source and destination paths with your
configuration.

Robocopy command breakdown

Robocopy has a lot of features that you can use, in the command shown in this guide, we’re
using the following switches to make copy reliable and fast.

 /S — Copy subdirectories, but not empty ones.


 /E — Copy Subdirectories, including empty ones.
 /Z — Copy files in restartable mode.
 /ZB — Uses restartable mode, if access denied use backup mode.
 /R:5 — Retry 5 times (you can specify a different number, default is 1 million).
 /W:5 — Wait 5 seconds before retrying (you can specify a different number, default
is 30 seconds).
 /TBD — Wait for sharenames To Be Defined (retry error 67).
 /NP — No Progress – don’t display percentage copied.
 /V — Produce verbose output, showing skipped files.
 /MT:16 — Do multi-threaded copies with n threads (default is 8).

Perhaps the most important switch to pay attention is /MT, which is a feature that enables
Robocopy to copy files in multi-threaded mode. Typically, when you copy files using File
Explorer, you’re only copying one file at a time, but with multi-threaded enabled, you can
copy multiple files at the same time better utilizing the bandwidth and significantly speeding
up the process.

If you don’t set a number when using the /MT switch, then the default number will be 8,
which means that Robocopy will try to copy eight files at the same time. However, Robocopy
supports 1to 128 threads.

In the command shown in this guide, we’re using 16, but you can set it to a higher number.
The only caveat is that the greater the number, the more processing power and bandwidth will
be utilized. If you have an older processor and a not reliable network connection, it could
mean trouble, as such make sure to test before executing the command with a high number of
threads.

You can always view all the available switches, simply run the robocopy /? command. If
you have any problems, you can submit your questions to the Pureinfotech forums.

Update January 10, 2019: This guide was originally published in November 2017, and it
was revised on January 2019.

Robocopy: Better, Faster, Stronger - Stephen Foskett, Pack Rat


Anyone doing much storage work on Microsoft Windows machines is familiar with
Robocopy. It’s the best tool to move data between NTFS filesystems, since Robocopy
maintains permissions and file attributes. It also tolerates dropped connections, resuming
where it left off, and can throttle operations over slow networks.

But Robocopy was never very quick, especially when dealing with large data sets. It was
single-threaded, hurting performance on high-latency networks, and startup was painfully
slow on deep directory structures.

Robocopy XXVII

Windows Vista, Windows Server 2008, and later versions include a new version of
Robocopy with performance tweaks designed to overcome these limitations. Right-click on
the executable in Windows\System32 and make sure you are using version XP027,
5.1.10.1027.
Update: Oops! Only the “6.1” versions of Microsoft Windows (Windows 7 and Windows
Server 2008 R2) include multi-threaded robocopy!

The big deal here is multi-threading:

 The application can now run in multi-threaded mode using the /MT option. This
defaults to 8 threads, but users can specify up to 128 if desired. For example, the
following command would use 16 threads:

robocopy c:\ d:\ /MT:16

 Initial directory enumeration is also multi-threaded, so deep directory structures are


examined much more quickly.
 XP027 also added the /EFSRAW parameter, allowing one to copy files from EFS using
RAW mode. However neither this nor /IPG (inter-packet gap) can be combined with
the multi-threaded option mentioned above.

Dead or alive, you’re coming with me!

I tried out the new /MT option on a Core 2 Duo laptop and was surprised by the dramatic
improvement in copy performance. Copying my entire “Program Files” directory took well
over a minute without multi-threading, but simply specifying “/MT” at the end of the
command reduced a second copy to a different directory to about 20 seconds. Using “/MT:32”
was blazing fast – easily less than 15 seconds. I repeated the first single-threaded test again
and watched it dawdle along, taking over a minute again to finish.

Microsoft suggests that multi-threaded Robocopy helps with network throughput as well.
I tried a series of copies between two Windows 7 machines over Wi-Fi, to simulate a slow
network. Although single-threaded Robocopy was able to saturate the network with large
files, it really slowed down (thanks to latency) once it hits a patch of smaller files. Multi-
threaded Robocopy was more capable of maintaining high throughput once smaller files were
encountered, with a 32-thread test keeping the link at maximum pretty much the entire time.
Again, a noticeable improvement.

Your Move, Creep

If you’re copying lots of Windows data on a machine running Windows 7 Vista or newer, I
can confidently say that the /MT switch will speed things up dramatically. Whether you
should stick with the default 8 threads or up it to 16 or 32 depends on the capabilities of your
CPU, but it’s worth a try. One more tip: Use the /LOG switch or pipe the output to NULL to
speed up copying even more. Displaying all that text delays the whole process!
How to use RoboCopy on Windows 10
RoboCopy Windows 10 – Robocopy (Robust File Copy) is a command-line tool built into
Windows 10, but it’s been around for years, and it’s a powerful and flexible tool to migrate
files extremely fast.

When you finished to install Windows 10, you may still need to transfer all your files to the
new device. Usually, you just use an external hard drive to copy your files and move it over
the new device. Or if you’re a tech-savvy user, you probably transfer the files over the
network to the new PC setting up file share.

How To Use RoboCopy on Windows 10

While these are all good options, depending on the amount of data you need to transfer, using
File Explorer, the process can take a very long time. If you want to copy (migrate) a lot of
files faster and more reliably, you need a better solution, such as Robocopy.

In this guide, you’ll learn the steps to use RoboCopy on Windows 10 to quickly transfer a lot
of files over the network.

RoboCopy Download

Robocopy is a command line utility for copying files. This command is available in Vista and
Windows 7 by default. For Windows XP and Server 2003 this tool can be downloaded as part
of Server 2003 Windows Resource Kit tools. This package is available in the below location.
RoboCopy GUI

Download RoboCopy

Download RoboCopy GUI

Download RoboCopy 3.1

How to use Robocopy to copy files over the network fast

The features included with RoboCopy allows you to copy files very quickly, but remember
that you’ll need a wired connection for the best experience. The time that will take to
complete the transfer will depend on the network connection speed and disks performance.

This is a two-step process. You must first configure file sharing on the source device, and
then use Robocopy in the destination device to perform the transfer.

Step 1: Configuring file sharing on Windows 10

In order to copy files between two computers, you must enable file sharing in the source
device, so that Robocopy can access and copy the files from the destination device.

To share files on your local network using the express settings, use these steps:

1.
1. Open File Explorer.
2. Navigate to the folder you want to share.
3. Right-click the item, and select Properties.

Folder Properties option


4. On the “Properties” window, click the Sharing tab.
5. Click the Share button.

Folder Sharing tab


6. Use the drop-down menu to select the user or group to share file or folder.
For the purpose of this guide, select the Everyone group.
7. Click the Add button.

Choose people to share with


8. Under “Permission Level,” select the type of sharing permissions you want the
folder to have. For example, you can select Read (default) if you only want
users to be able to view and open files. If you select Read/Write, users can
view, open, modify, and delete the content on the folder you’re sharing.
9. Click the Share button.

Share permission level


10. Note the network path for the folder that other users will need to access the
content over the network and click the Done button.
11. Click the Close button.

Shared folder path

After completing the steps, make note to of the folder path and the IP address of your source
computer.

Quick Tip: You can quickly find out your IP address on Settings > Network & Internet,
click Wi-Fi or Ethernet, and click the connection to view the information.
Step 2: Using Robocopy to quickly copy a lot of files on Windows 10

Once file sharing is configured on the source device, you can proceed copying the files using
Robocopy from the destination device.

To use Robocopy to copy files fast on Windows 10, use these steps:

1. Open Start.
2. Search for Command Prompt, right-click the result, and select Run as administrator.
3. Type the following command to copy the files over the network and press Enter:
robocopy \\source-device-ip\path\to\share\folder C:\destination-
device\path\to\store\files /S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16
Example:
robocopy \\10.1.2.111\Users\admin\Documents
C:\Users\admin\Documents /S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16
Robocopy Command Prompt

In the above command make sure to change the source and destination paths with your
configuration.

Robocopy Command Syntax

Robocopy has a lot of features that you can use, in the command shown in this guide, we’re
using the following switches to make copy reliable and fast.

 /S — Copy subdirectories, but not empty ones.


 /E — Copy Subdirectories, including empty ones.
 /Z — Copy files in restartable mode.
 /ZB — Uses restartable mode, if access denied use backup mode.
 /R:5 — Retry 5 times (you can specify a different number, default is 1 million).
 /W:5 — Wait 5 seconds before retrying (you can specify a different number, default
is 30 seconds).
 /TBD — Wait for sharenames To Be Defined (retry error 67).
 /NP — No Progress – don’t display percentage copied.
 /V — Produce verbose output, showing skipped files.
 /MT:16 — Do multi-threaded copies with n threads (default is 8).

Perhaps the most important switch to pay attention is /MT, which is a feature that enables
Robocopy to copy files in multi-threaded mode. Typically, when you copy files using File
Explorer, you’re only copying one file at a time, but with multi-threaded enabled, you can
copy multiple files at the same time better utilizing the bandwidth and significantly speeding
up the process.
If you don’t set a number when using the /MT switch, then the default number will be 8,
which means that Robocopy will try to copy eight files at the same time. However, Robocopy
supports 1to 128 threads.

In the command shown in this guide, we’re using 16, but you can set it to a higher number.
The only caveat is that the greater the number, the more processing power and bandwidth will
be utilized. If you have an older processor and a not reliable network connection, it could
mean trouble, as such make sure to test before executing the command with a high number of
threads.

You can always view all the available switches, simply run the robocopy /? command. If
you have any problems, you can submit your questions to the Pureinfotech forums.

RoboCopy Examples

Robocopy command is used on Windows to copy files and directories from one location to
another. This CMD command also prints a detailed report of the copy operation. Below you
can find examples for using Robocopy in various usecases.

Copy a directory

Example: Copy all the files in the directory D:\dir1\data to E:\backup\data. Don’t include sub
directories or the files stored in those.
Robocopy D:\dir1\data E:\backup\data
The above command copies system files and hidden files too. Copy and Xcopy commands
skip these files by default.
At the end of the command execution, it would print the summary like below.

Total Copied Skipped Mismatch FAILED Extras

Dirs : 22 22 0 0 0 0

Files : 113 113 0 0 0 0

Bytes : 42.96 m 42.96 m 0 0 0 0

Times : 0:00:01 0:00:00 0:00:00 0:00:00

Speed : 83744483 Bytes/sec.

Speed : 4791.897 MegaBytes/min.

Ended : Wed Oct 22 22:26:14 2014


Copy directory structure

Run the below Robocopy command to copy directory structure i.e deep copy of folder
hierarchy and the data in all the subfolders.
Robocopy /S D:\dir1\data E:\backup\data
This command does not copy empty directories. To copy them, you need to add /E switch.
Robocopy /S /E D:\dir1\data E:\backup\data

Delete files and directories from the source after copying

You can add /MOV switch to delete files and /MOVE switch to delete both files and
directories.

For deleting files:


Robocopy /MOV /S /E D:\dir1\data E:\backup\data
For deleting files and directories:
Robocopy /MOVE /S /E D:\dir1\data E:\backup\data

Modify file attributes for the copied files

Using robocopy command we can also change attributes(system, hidden, readonly) of the
copied files. This affects the attributes of the files in the new location, it does not impact the
files in the source directory.

For example to copy all files from one directory to another directory and also set hidden
attribute for all the files you can trigger ‘Robocopy’ with the below syntax.
Robocopy /S /E /A+:H D:\dir1\data E:\backup\data

Mirror copy a directory

Below Robocopy command creates a replica of the source folder in the specified destination
folder
Robocopy /MIR sourceFolder destinationFolder

This command also deletes any extra files that are present in the destination and are not
present in source.

Replicate access permission on destination folder

The option ‘/sec’ copies all the file access permissions to the destination folder also.
robocopy /sec sourceFolder destinationFolder
Note that Robocopy copies the security ACLs also to the destination only if the file has been
modified. If the file has not been modified, the ACLs won’t be applied on the destination.
You can check this Microsoft’s post robocopy file permissions for deeper understanding.

Conclusions
Robocopy: Better, Faster, Stronger. It’s hard to take a product called “Robocopy” seriously!
Anyone doing much storage work on Microsoft Windows machines is familiar
with Robocopy. It’s the best tool to move data between NTFS filesystems,
since Robocopy maintains permissions and file attributes.

FreeFileSync
I would like to ask if it is possible to implement FFS an option allowing to preserve the dates and
times of copied directories. I have already found an answer in the forum that the behavior of FFS is
the same as Windows explorer does, however this is what I would like to use differently. Do you
consider to implement this feature in the future or is it for some reason not possible? Thank you.

*I'll try to explain this to the best of my knowledge and as to how I understand this may happen.

FFS does keep the creation date in directories, it doesn't however, keep the modified date in sync.
On the initial syncing, the folder will have the same modified date and creation date, on both
sides. The folder is copied as is, all attributes. It doesn't however, keep the modified date in sync,
since syncing only overwrites/syncs files and not the folder itself.

When a file changes and is compared by modified date, the file is copied over and overwrites the
older one. When a folder's contents changes, its date modified changes and then what? you can't
just simply re-copy the folder like you do with files because the folder is already there, and if that
is done all files will be overwritten all over again. Should it just copy the date modified attribute
on a folder that had its files changed? It already made changes to the files within the folder and
hence why the modified date changed on the folder to the date you did the sync. A folder is
created just once and both dates are preserved since it is well a "creation" and attributes are
copied over, files however, are always changing and are copied over/overwritten, an overwrite is a
"creation" and all attributes go with it all, just like with a folder's first sync. When you sync files,
you are either overwriting or deleting what doesn't exist. Renames do not change the date
modified attribute hence, why they simply are always in sync during renames.

FFS compares files themselves, it looks at the file level, it doesn't really compare folder modified
date, just whether it exists or not. It doesn't take folders attributes as a syncing object unless the
folder doesn't exist on one of the sides or it had its name changed, since files by themselves
indicate what needs to be synced. It doesn't scan and say "hey this folder changed, lets sync the
files or lets overwrite the entire folder again". It looks at the files and simply syncs the files, since
the folders attributes have no use in the syncing process.

It is possible to copy just the attribute, and it is rather simple. The complex part would be using
folders as a syncing object. They would have to now be considered each time whether or not a file
is compared. I guess this would lengthen the scan process quite a bit, since now, you would have
to check thousands of folders and compare them. Or, should they just be considered only for the
detected changed file's root directory? E.g: if a file changes in c:\a\ and not in c:\b\ ignore
modified date comparison of b and just do a?

In summary, folder attributes have no use in the comparison algorithm since the files are the ones
that dictate what transfers over. Both creation date and modified date are synced on an initial
sync because it is a new creation. The creation date of folders is retained always since folders are
only created once, and then have their file contents modified which are the ones being edited.
Only when a folder is deleted or renamed it is actually considered since now the "table" of
changes has had an entry added, removed, or edited. It is the nature of the beast, since files and
folders only keep the dates when copied and recreated new or overwritten. For FFS to keep the
modified date the same just as it does with files, it would have to recopy and overwrite the entire
folder as a "whole". But since it doesn't do that, and instead syncs the "content" that changed, it
needs to be copied manually some other way.

*Your explanation makes sense, but a couple of additional thoughts here. First, each top level
folder in the folder pairs has the modify date changed every time the sync is run, regardless of
whether any changes are made or not. That's because of the "sync.ffs_lock" that gets updated in
the folder. So this is one thing that is a bit of a "false positive" on the time stamp. This one is
minor, but potentially something that could be addressed.

The other thing, much more important in my mind, is that every subfolder has its modify date
reset on the initial creation when new files are added, per the explanation, which makes perfect
sense. However, if, at the end of the session, you were to reset the modify date of any newly
created folder to match the source, that would really work out perfect.

I love the program and I can live with the above, but I just thought I'd offer a little more info and
a suggestion.

*(I'll just point out, for Windows users, Nirsoft's FolderTimeUpdate is a simple tool for Windows
that scans all files and folders under the base folder you choose, and updates the 'Modified Time'
of every folder according the latest modified time of the files stored in it.

This tool might be useful if, for example, you backup a cluster of folders and then restore them
into another disk, but the backup program doesn't restore the original modified time of the
folders.)

*I agree, at the end of the session the FFS can go back and reset the folder dates and times to
their originals - This is EXACTLY what directory OPUS does optionally. I too would love to see this
implemented as it is the only thing stopping me from completely adopting FFS.

If therer are there are any developers reading this thread, could you kindly give us an update as to
whether this feature is being looked at or will be implemented?

Thank you for listening.

SafeCopy Free
https://www.elwinsoft.com/safecopy-free.html

SafeCopy Free! - Freeware utility for Windows to copy files and folders from one location
to another and preserve or modify file attributes and date-time stamps.

Interface
File or folder can be submitted for copy operation by dropping into the Source frame
while navigating Explorer directories. The destination folder can be set the same manner.

SafeCopy Free utility. The main window.

Portable utility

You can run the utility by clicking the executable file, no setup required. You can store it
on USB flash drive or other portable device.

Command line mode

safecopyfree <source_path> <destination_path> [switch1] [switchN]


Source path - specifies the path to folder or file to copy.
Destination path - specifies the location of new file(s)/folder(s)

Switches
/t - copies only directory structure without files (including empty directories and
subdirectories.
/r - copies subdirectories.
/f - copies folder itself.

Attribute switches
Attribute switch syntax: [/Attribute[+|-]] - Forces utility to set or reset attribute.
By default SafeCopy Free! Trying to keep attributes while copying files.
Date-time switches
/c<date> - sets Created date-time on files and folders.
/m<date> - sets Modified date-time on files and folders.
/a<date> - sets Accessed date-time on files and folders.

Group of date-time switches


You can assign new date-time value to several date-time stamps using one switch. Just
combine letters c m a in one switch as shown below.
/cma<date> - sets Created, Accessed and Modified date-time on files and folders to the
specified date-time.
/cm<date> - sets Created and Modified date-time on files and folders to the specified
date-time.

Valid date-time strings are:


2017-10-01t09:12:00 - 01 October 2017 09 hour 12 minutes 00 seconds. You can
specify date-time without delimitres: 20171001091200

Examples

To copy contents (with subfolders) of d:\source_path to drive e:\ and keep all date-
time stamps and attributes, use following command-line:

C:\SafeCopyFree d:\source_path e:\ /r


Command-line to copy contents of d:\source_folder to
the e:\destination_folder and set specified Created date-time and keep attributes:

C:\SafeCopyFree d:\source_folder e:\destination_folder /c2017-10-


01t09:12:00

Windows Explorer and file date-time stamps

Windows Explorer's copy/move does not preserve date-time stamps for directories and
files. The behavior of Windows Explorer when copy/move files or folders depends on the
version of Windows in use.
Windows XP SP3
Modified Accessed Created

NTFS Drive C: --> NTFS Drive D:

Copy file Keep Current date-time Current date-time

Move file Keep Current date-time Keep

Copy/move empty folder


Current date-time Current date-time Current date-time
or folder with files

NTFS Drive C: --> FAT16 or FAT32 Drive D:

Copy file Keep Current date Current date-time

Move file Keep Current date Keep

Copy/move empty folder


Current date-time Current date Current date-time
or folder with files
Windows 7
Modified Accessed Created

NTFS Drive C: --> NTFS Drive D:

Copy file Keep Current date-time Current date-time

Move file Keep Current date-time Keep

Copy empty folder keep Current date-time Current date-time

Move empty folder keep Current date-time keep

Copy folder with files Current date-time Current date-time Current date-time

Move folder with files Current date-time Current date-time Keep

NTFS Drive C: --> FAT16 or FAT32 Drive D:

Copy file Keep Current date Current date-time

Move file Keep Current date Keep

Copy empty folder


Keep Current date Current date-time
or folder with files

Move empty folder


Keep Current date Keep
or folder with files

Windows 8.1
Modified Accessed Created

NTFS Drive C: --> NTFS Drive D:

Copy file, copy folder Keep Current date-time Current date-time

Move file, move folder Keep Current date-time Keep

NTFS Drive C: --> FAT16 or FAT32 Drive D:

Copy file or folder Keep Current date Current date-time

Move file or folder Keep Current date Keep

NTFS Drive C: --> exFAT Drive D:

Copy file or folder Keep Current date-time Current date-time

Move file or folder Keep Current date-time Keep

Copy a Folder to Another Folder and Retain its Permissions


This step-by-step article describes how to copy a folder to another folder and retain its
permissions.

When you copy or move files and folders by using Windows Explorer, the permissions
that are set on the files or folders may change. For example, when you copy a file in an
NTFS file system volume or between two NTFS volumes, Windows 2000 treats it as a new
file. As a new file, it takes on the permissions of the destination folder, and you become
the CREATOR OWNER.

NOTE: You must have Write permission for the destination folder to copy files and
folders.
You can use the Xcopy command with the /O/X/E/H/K switches to copy the files and
retain the existing permissions that have been specifically applied to the file or files.

These switches have the following effects:

/E - Copies folders and subfolders, including empty ones.


/H - Copies hidden and system files also.
/K - Copies attributes. Typically, Xcopy resets read-only attributes.
/O - Copies file ownership and ACL information.
/X - Copies file audit settings (implies /O).
NOTE: This procedure does not override inherited permissions. When you use the Xcopy
command with the /O /X /E /H /K switches to copy the files, the following inherited
permissions apply:

 The security settings that are directly assigned to the files and folders are retained.
 The security settings that are inherited from the source parent folder are lost.
 The security settings of the destination folders are inherited.
 When you move files or folders to FAT volumes, the folders and files lose their NTFS
permissions because FAT volumes do not support NTFS permissions.

For more information about inheritance, see the "Changing inherited permissions" topic
in Windows Help.

Copy a Folder to Another Folder and Retain its Permissions


1. Click Start, and then click Run.
2. In the Open box, type cmd, and then click OK.
3. Type xcopy sourcedestination /O /X /E /H /K and then press ENTER,
where source is the source path for the files to be copied, and destination is the
destination path for the files.
Example

Type xcopy c:\olddocs c:\newdocs /O /X /E /H /K, and then press ENTER,


where olddocs is the source folder and newdocs is the destination folder.

For more information about Xcopy switches, type xcopy /? at the command prompt, and
then press ENTER.

How to preserve file attributes


File creation time is only one of the file attributes
Creation time: if the target file already exists, its' creation time is preserved, otherwise it
is set to the current system time.
Last Modification time: always copied from modification time of the source file.
Last Access time: always set to the current system time.

There is also folder attributes


A way can preserve file attributes but doesn’t have preserves folder one.

Robocopy
-RoboCopy can preserve the mtime for directories with the /DCOPY:T switch, but this
only works in Vista and newer. It can also preserve ACLs. Alternatively, FastCopy can be
configured to preserve directory mtimes, ACLs, and ADSes.

-In Windows robocopy is the recommended way to do this since it not only copies
file/folder attributes but also allows for proper file integrity and error handling during the
entire copy process.

-I agree that as of now robocopy has no pre-post checksum comparison feature. But in
general, robocopy will retransmit the entire file when an error occurs. If you want it to
resume writing the rest of a file to the destination after an error occurred without
transmitting the entire file again you specify the /Z switch.

-because the question isn't about mirroring a tree, it's about copying files and folders and
preserving as much metadata as possible. Not only does /mir remove data from the
destination folder, you still needed the /dcopy:t to preserve directory mtimes
and /copyall to preserve more than just the file timestamps.

- RoboCopy should be able to do it with the COPYALL switch. You can grab the GUI
version from Microsoft Technet.

- Robocopy command line tool (comes with most versions of windows)


On my windows 10 machine it is located at C:\Windows\System32

From Wikipedia, it can be used with the following set of options to preserve
file and directory timestamps, as well as other attributes:
Robocopy C:\some_directory D:\some_directory /DCOPY:T /COPYALL /E /R:0

 /DCOPY:T preserve original Directories' Timestamps (requires version XP026 or later)


 /E: Copy directories recursively, including Empty Directories
 /R:0: do not retry locked files (the number of retries on failed copies default value is 1
million),
 /COPYALL: Copy all file information,
(equivalent to /COPY:DATSOU, where
 D=Data,
 A=Attributes,
 T=File Timestamps,
 S=Security=NTFS ACLs,
 O=Owner info,
 U=Auditing info),

If you only want to preserve date and directory timestamps, but do not want empty
subdirectories copied over and do not want other attributes preserved then you may use:
Robocopy C:\some_directory D:\some_directory /DCOPY:T /COPY:T /S

where /S copies non-empty subdirectories

To see the full syntax, type robocopy /? at a command prompt, or take a look at these
blog posts: https://ss64.com/nt/robocopy.html and https://techjourney.net/robocopy-syntax-
command-line-switches-and-examples/

An example of a command I recently ran:


Robocopy D:\ C:\D_backup /DCOPY:T /COPYALL /E /R:0 /ZB /ETA /TEE /V /FP /XD
D:\$RECYCLE.BIN /XD "D:\System Volume Information" /LOG:C:\D_backup_robocopy.LOG
/MIR

Notice how excluding 2 subdirectories requires the /XD flag to be used twice. Also, the
second directory exclusion uses quotes because there are spaces in the directory name.

Finally, you can add the /L flag to test the command before doing it for real. In this way
you can verify it won't copy (or remove) any directories/files that you do not want, and
that there are no errors in your command.

Edit: gotcha when copying from a Root Directory (aka drive) to a Folder (non-root
directory)

After running the example command above, the directory was not visible! (Even
though show hidden files and show system files were checked in Windows 10!) The
following command as per https://serverfault.com/a/455029/399723 fixed this:

attrib -h -s C:\D_backup

Alternatively, adding the /A-:SH "unsets the Hidden Attribute from System files", thus may
prevent the directory from becoming hidden in the first place, as
per https://serverfault.com/a/565804/399723. See also https://ss64.com/nt/robocopy.html.
This descussion sheds more light on this option as a solution.

Robocopy D:\ C:\D_backup /A-:SH /DCOPY:T /COPYALL /E /R:0 /ZB /ETA /TEE /V /FP /XD
D:\$RECYCLE.BIN /XD "D:\System Volume Information" /LOG:C:\D_backup_robocopy.LOG
/MIR

Other Software:

Alternatively, you can download a GUI version of robocopy if you don't want to use the
command line.

Another windows utility is XCopy, though it is included in windows 10, it is being


deprecated. See the link for gotchas.
The Wikipedia page for RoboCopy (linked at top of this post) lists other software that can
be used.

Synchronize it
Synchronize It! 3.5 keeps all timestamps (files and folders, modification and creation). It's
the only software I know on Windows XP which does that flawlessly, beside Robocopy,
and I've tried many. Beware, though, it can produce corrupted files with source files
downloaded using software like FlashGet or Orbit Downloader (the resulting files have
the same size but only 25kB is actually copied - the rest is filled with zeros). I asked the
creator of the software if he could figure out why, but he had no clue; I guess it has to do
with such software downloading files in small packets (intended to optimize speed) and
my data partition being hugely fragmented.
Robocopy XP026 is indeed included in Windows Vista, but works on Windows XP.
Search "Robocopy XP026", or I can send the file here as it's not very easy to find. Or you
can install Robocopy GUI and then search for the robocopy.exe file in the System32
folder, so as to use it from the command line. The file I have is 208kB and the version
number is 5.1.2600.26.

There seems to be a bug with the "backup mode", though:

http://msmvps.com/blogs/martinzugec/archive/2008/03/03/ugly-bug-in-robocopy-
ignoring-security-on-file-level.aspx

Robocopy version XP027 apparently no longer has this bug but it doesn't work on
Windows XP.

FastCopy
FastCopy can do this and it is free.

Software preserving creation, date and time

-http://lantechsoft.com/data-copy.html
-http://technocomsolutions.com/data-copy-tool.html

FreeFileSync
-I've been happily using FreeFileSync to back up selected folders without realizing its
usefulness in preserving the date information during a copy. The first test was to move
the memory card from my Canon camera to my laptop PC and perform a Synchronize
with the Mirror setting. The second test was with the memory card in the camera. Both
tests resulted in files copied with the original datestamp. Correction: Copying from the
camera does not work properly.

-FreeFileSync (https://www.freefilesync.org) use the Mirror setting. It preserves creation


timestamps and won't hang on an error. Does a lot more but should solve this problem.
How to Copy Fi;les without Changing Date Stamp on Windows
10

Solved: Windows 10 Copy Files Preserve Timestamp

When you copy a file from one location to another on your computer, a new file is created
with new timestamp. This is quite annoying if you want to manage photos imported from
digital camera or mobile phone by taken date. Cut & paste can avoid this problem, but you
might have to recover lost photos if the transfer is accidentally interrupted. Actually,
Windows 10 hides a useful feature from us which allow people to copy files and preserve
timestamp.

Timestamp Types of a File

When a photo is taken on digital camera or mobile phone, the taken time is stored into its
metadata along with other information, like camera name and edit program. The
embedded Date takenwon’t change subsequently, but may lose due to some reasons. The
equivalent date for document is called Content created. When you save the photo or
document after editing, the timestamp will also be stored, separately as Date
modified and Date last saved.

However, the most obvious timestamps that we can easily notice in a Windows 10 computer
are provided by the operating system. When we import files that were not created in this
computer, the system will see them as new files and assign them new timestamps: Created,
Modified and Accessed. The rule also applies to files created by copy and paste. Usually,
Windows system displays the new Created time in File Explorer by default. Though we can
add Date taken or Date modified to the status bar, the setting only works in one folder each
time. If we can copy files without changing date stamp from the very first, then why go
through the hassle?

We can check the timestamps of a file on General and Details tabs by right-click and choose
Properties. Then, how can we tell Windows to preserve the timestamp on file copy? We can
do it with a command line.

Robocopy Command Line

Robocopy (Robust File Copy) is a command-line directory and/or file replication command. It
was first introduced in Windows Vista and Windows Server 2008, and kept in Windows 10.
Benefits of copying files using ROBOCOPY command:

 Preserve original timestamp


 Faster than normal File Explorer transfer
 Efficiently copy all files of the same format from all subdirectories to destination
while keeping original structure

How to Copy Files without Changing Date Stamp

Robocopy is a command that we use in Command prompt without any third-part software.
Please follow steps below.

 Step 1. Press Windows key + R.


 Step 2. Input “CMD” and hit enter to open Command prompt. Click OK when
Windows User Control pops up.
 Step 3. Type Robocopy commands to copy files while preserving timestamp.

Depending on how you want to do the transfer, there are different commands. Keep reading to
know which to choose.

Robocopy Command Samples

Robocopy command has a simple structure:


ROBOCOPY source destination [file [file]…] [options]
However, there are a lot of options functioning for various purposes. Here we demonstrate
how to copy files with Robocopy for common usage with examples. Please open Command
prompt, then try them by typing a command and hitting enter.

1. Copy files in Download folder from D:/MyWork to H:/Backup

Robocopy d:\MyWork\Download h:\Backup


This doesn’t include subdirectories in Download folder. If there is no Backup folder in
destination location, the system will create it automatically. Make sure the destination is a
new empty folder if you don’t want the copied files to mess up with other existing files.

2. Copy Download folder including subdirectories from D:/MyWork to H:/Backup

Robocopy d:\MyWork\Download h:\Backup /s


By adding /s, the command tells the system that you want to include all subdirectories in
D:/MyWork/Download path, but not including empty folders.
3. Copy a picture Dog.jpg from D:/MyWork/Download to H:/Backup

Robocopy d:\MyWork\Download h:\Backup Dog.jpg


If you just want to transfer a single file, just type the complete filename at the end.

4. Copy all jpg files from D:/MyWork/Download to H:/Backup

Robocopy d:\MyWork\Download h:\Backup *.jpg


This command will copy all jpg files in Download folder to destination location. If you want
to include jpg files in subdirectories in Download folder, just add /s to the end. Copied jpg
files from subfolders will be saved with original structure.

For more options in Robocopy syntax, you can type robocopy /? at Command prompt.
However, some commands may wipe certain existing files. If you lost important files
accidently, please try Windows file recovery solution as soon as possible.

Now you should know how to copy files on Windows 10 and preserve original date stamp
with Robocopy command. This method should also work on previous Windows 7/8. Feel free
to tell us whether it works for you or not.

How to preserve original attributes


I have an oldish computer with four ~500 GB 3.5" hard drives installed and there are
perhaps a dozen partitions total. What I want to do is make a collated backup of all of
these files on a single 2 TB portable 2.5" drive, and instead of multiple partitions, there
will be multiple folders stored inside a folder called 'Old Computer' instead.

I would like to copy the files so that the attributes are the same on both the origin and
destination, previously I [Ctrl+C, Ctrl+V] copied the files from one drive and the date of
the folders on the new location matched the actual time of copying, which I don't want, I
find it useful to see when a folder was originally created, so I want to keep all these the
same.

Any ideas?

I'm fairly certain there is an option inside Robocopy to do just this.

Run help on robocopy (robocopy /?) and look for /COPY and /COPYALL arguments.

15 Free File Copy Tools Tested for the Fastest Transfer Speeds
Most of us know that it is possible to perform folder and file copy or move operations in
Windows by either using your mouse to copy and paste, drag and drop or by using a number
of keyboard shortcuts. Obviously the single biggest factor affecting the speed of any transfer
is what medium you’re copying from or to such as hard drives, SSD’s, USB sticks, network
etc. Another factor is how Windows itself deals with these operations, and all versions of
Windows have never been quite as efficient at it as they could be.
With this in mind, it is entirely possible to shorten the duration of any copying or moving of
files if you use a piece of third party software to take over operations instead of relying on the
Windows built-in function. Not only can this help the speed of transfers, but you can also get
other benefits like better information, queuing copies, pausing, skipping, and dealing with
problematic files far better than what Windows does.

We were curious to find out just how fast some of these programs actually are when copying
and moving files around in Windows, so have gathered together 15 freeware tools to have a
closer look. A few simple tests were carried out to try and determine which file copying tools
are the fastest at performing file transfers in a few different real world scenarios. To try and
cover some common file copy operations, 3 tests were conducted;

Test 1: Copy a number of small to medium files from one HDD to another.

4GB totaling 24,185 files / 6193 folders with sizes of a few bytes to 320MB.

Test 2: Copy 2 large files using the same source and destination as test 1.

2x Windows 8 ISO’s (x86 and x64) totaling 5.8GB.

Test 3: Copy over a 10/100 LAN network to the same destination as tests 1 and 2.

450MB totaling 5665 files / 723 folders with sizes of a few bytes to 320MB.

The source drive was a 10,000 RPM WD Raptor and the destination was a standard 7200
RPM SATA drive, both defragged. All the 3rd party software was run using their default
transfer settings on a clean and fully updated install of Windows 7 64-bit. Each test was run
twice and an average of the times was taken.
If you want to jump straight to the results table and a summary of the findings about who
performed best and worst, they can be found on page 2.

1. Copy Handler 1.32

Copy Handler is a tool that while it sits in your system tray, can take over the file copying
operations from Windows or monitor the clipboard for files. During a copy a small and simple
window will appear with basic details, double clicking will give you the full window with a
wealth of stats and past / present operations. There’s a number of pause and resume buttons,
context menu entries can be added and an options window to configure most areas of the
program.

Multiple file copy test 1: 154 seconds


ISO copy test 2: 141 seconds
Network copy test 3: 98 seconds

Download Copy Handler

2. ExtremeCopy Standard 2.1.0

There are 2 different version of ExtremeCopy, the standard free one and the full shareware
version. Functions such as copy or collision options, window position, failed file recovery and
the buffer size are disabled in the free version, but you can still integrate it into Explorer to
take over the standard Windows file copy functions. Pause, skip and verify are also present. A
small options window pops out from the copy dialog using the arrow in the top left. For the
USB stick a slightly older portable version is also available.

Multiple file copy test 1: 111 seconds


ISO copy test 2: 86 seconds
Network copy test 3: 262 seconds

Download ExtremeCopy Standard

3. FastCopy 2.11

FastCopy is a tool that’s been recommended by a lot of people over the years because it’s a
simple and yet incredibly fast file copier. There are a number of buffer options to tweak the
performance even further, basic or advanced file filters, an NSA method wipe and delete
option, verify and copy / sync / differential / overwrite copy modes. It also has several options
for adding context menu entries and extensive command line options, although something
missing is a pause or skip button. Watch out for the weird uninstaller where you have to rerun
the setup exe.
Multiple file copy test 1: 110 seconds
ISO copy test 2: 86 seconds
Network copy test 3: 79 seconds

Download FastCopy

4. FF Copy 1.0

FF Copy is relatively simple copying tool where you select or drag and drop multiple
selections of files and folders onto the window and they will be copied or moved to the
destination you select from the button or drop down. There are no other options to speak of
and this tool probably functions best when you want to quickly send files from multiple
locations to several different folders and then let it process them.
Multiple file copy test 1: 163 seconds
ISO copy test 2: 86 seconds
Network copy test 3: Refused to copy the folder, gave an error every time.

Download FF Copy

5. KillCopy 2.85

KillCopy is a copy tool that doesn’t look too great out of the box and the theme below called
“Standart” was about the best built into the program. There are some downloadable themes
from the website but they aren’t that great either. The program itself has several useful
features such auto resuming after a system crash, parallel copy mode and several boosting and
buffer settings to try and eek out that extra few MB/s. KillCopy can place copy and move
entries onto the context menu and can also be setup to be the default copy handler replacing
Explorer.
Multiple file copy test 1: 131 seconds
ISO copy test 2: 88 seconds
Network copy test 3: 78 seconds

Download KillCopy

6. Mini Copier 0.5

This copying tool is a little different than the others here because it was written in Java
meaning there are different versions for Windows, Linux and Mac OSX, although this does
make for a hefty 20MB installer. The program is similar in looks to SuperCopier but adding
files and folders is done entirely by dropping them onto the red basket in the program’s
window. When you’re ready to copy, drop the destination folder onto the right icon and the
process will begin. Standard pause and skip buttons are available.

Multiple file copy test 1: 166 seconds


ISO copy test 2: 89 seconds
Network copy test 3: 130 seconds

Download Mini Copier


7. NiceCopier 12.10.31

NiceCopier does actually live up to its name and is quite a nice looking tool and will show
you either a small progress window in a corner of the desktop or expand to a full dialog
window where you can alter the transfer speed and edit the files list including any ignore /
replace / rename options that need to be configured. NiceCopier will take over Windows file
operations while it’s running in the system tray and while there’s a lot of information in the
dialog windows, it’s all relevant and well laid out. A large window will alert you to any file
collisions etc.

Multiple file copy test 1: 147 seconds


ISO copy test 2: 87 seconds
Network copy test 3: 129 seconds

Download Nice Copier

8. PerigeeCopy 1.6

PerigeeCopy has several useful functions built in such as replacing Explorer for default file
operations, using or ignoring the recycle bin when deleting files, leaving errors until the end
of the copy process and 6 different overwrite options. The main copy dialog is quite
informative but there are no extra features like pause, queue or skip for that extra bit of
control.
Multiple file copy test 1: 186 seconds
ISO copy test 2: 89 seconds
Network copy test 3: 101 seconds

Download PerigeeCopy

File copy tools 9 – 15 and the results/summary are on page 2.

9. RichCopy 4

RichCopy is actually a tool developed at Microsoft and was used internally by them to copy
files for several years before being made available to download. It’s a multi threaded program
allowing many files to be copied in parallel and has several of the functions you might want
from a 3rd party copy program such as pause, resume, verify, profiles, file / directory
filtering, multiple sources at once and full command line support.
Multiple file copy test 1: 223 seconds
ISO copy test 2: 233 seconds
Network copy test 3: 64 seconds

Download RichCopy

10. SuperCopier 2.3

SuperCopier is an open source transfer utility and is quite similar in looks and functionality to
UltraCopier apart from this tool seems to be more stable. Most actions are accessed from the
system tray including adding a new copy task and it has the standard pause / resume / skip
buttons in addition to the copy list and several options to deal with errors or file collisions.
Buffer size and Transfer speed can also be controlled from the Configuration window.
Multiple file copy test 1: 187 seconds
ISO copy test 2: 92 seconds
Network copy test 3: 98 seconds

Download SuperCopier

11. TeraCopy 2.27

TeraCopy is one of the most popular tools around because it can completely replace Windows
Explorer as the default copy handler and also adds itself to the context menu. It can also
pause, skip and verify copied files using CRC32 in addition to dragging and dropping files
onto the copy queue. A portable version is made available using the installer and users of
Total Commander and Directory Opus have options to integrate TeraCopy into those file
managers.
Multiple file copy test 1: 147 seconds
ISO copy test 2: 110 seconds
Network copy test 3: 102 seconds

Download Teracopy

12. UltraCopier 0.3.1

We had a few problems with the latest version of UltraCopier 0.4 as it kept throwing up errors
during transfers and then crashing. The earlier 0.3.1 did work well enough to test though, so
bear that in mind. The program will replace Explorer by default while it’s running in the
system tray and one odd thing is it keeps expanding the copy dialog window to fit in long file
names. Standard functions such as pause and skip are available as well as a copy queue and
several options on what to do for file collisions or issues.
Multiple file copy test 1: 184 seconds
ISO copy test 2: 86 seconds
Network copy test 3: 92 seconds

Download UltraCopier

13. Unstoppable Copier 5.2

Roadkil’s Unstoppable Copier has been around a while and is a popular tool for copying as
much data as possible from corrupted or damaged discs and drives. The program does have a
number of useful features including a batch mode which you can run from the command line,
logging, a right click context menu entry and several options on how to treat potentially
corrupted or damaged files. A portable version is also available.
Multiple file copy test 1: 435 seconds
ISO copy test 2: 96 seconds
Network copy test 3: 175 seconds

Download Unstoppable Copier 5.2

14. WinMend File Copy 1.4.2.0

WinMend would certainly win a prize for its nice looking interface and is certainly a more
novice friendly tool because it has no options to speak of apart from a buffer slider and the
ability to overwrite or skip matching files at the destination. The copy process can be paused
and resumed, but other than that, WinMend File Copy is pretty much standard.
Multiple file copy test 1: 213 seconds
ISO copy test 2: 195 seconds
Network copy test 3: 118 seconds

Download WinMend File Copy

15. WinRoboCopy 1.2

WinRoboCopy is simply a GUI interface for the built in Robocopy command line utility
present in Windows Vista and above. It’s not for the novice because a lot of the buttons and
tick boxes are the command line switches. It does however have a built in scheduler, drag and
drop onto the window, a simple before and after script editor and a settings (or Robojob) saver
for different copy profiles.
Multiple file copy test 1: 162 seconds
ISO copy test 2: 90 seconds
Network copy test 3: Wouldn’t copy over the network.

Download WinRoboCopy

We tested 4 other file copy tools and they weren’t included for various reasons; LD Move was
in the top 4 or 5 in the ISO copy test but constantly crashed in tests 1 and 3. A similar tool
called QCopy , also completed the ISO copy fine, but after 20 minutes of copying the smaller
files, we gave up because it reported there was still several hours to finish, even with the
network copying which it was designed for. After 20 minutes SchizoCopy and Bit
Copier both progressed at less then 1% per minute which meant they would have taken over
an hour an a half to finish a test others were completing in under 2 minutes.

The Results and Findings

Here’s a table summary of all the results from each software in the 3 tests performed. To add
a baseline and for curiosity, Windows XP, 7 and 8 (both 64-bit) were also included to see how
their default Windows transfer performs. Do note that the operating systems are clean and at
stock settings with nothing turned off to help improve the results, including Windows
Defender. Green is the fastest followed by yellow in 2nd. Red is the slowest and orange the
2nd slowest.

The Main Points:

 In an equal test it was a surprise and disappointment to see Windows 8 perform so


poorly after all the improvements Microsoft are supposed to have made to it. This is
explained to a large degree though by the Security Essentials antivirus part of
Windows Defender scanning every file and slowing everything down, so you get
better security out of the box but slower transfer speeds. In a quick test with it
turned off, the result was comparable to Windows 7.

 Probably the most popular tool TeraCopy was really in the middle of the pack overall
in terms of outright speed. The multiple file copy test 1 result was quite good but in
both tests 2 and 3, it was distinctly average.
 For pure copying speed you really can’t look past Fast Copy. It won both file copy
tests and was a close 3rd in the network test.

 If you don’t want to copy files over a network, Extreme Copy is also a very fast tool
and a close second or equal to Fast Copy in 2 of the 3 tests. But for network usage,
Extreme Copy was consistently the slowest software to complete that test.

 Although its disc to disc copying was awful, RichCopy was the clear winner in the
network test and was designed with high latency or low bandwidth networks in mind.
It’s something you might like to look at if you perform a lot of network transfers.

 As it’s a popular tool we had to include Unstoppable Copier, but the results may
seem a bit unkind because it was one of the slowest overall. The program is more of
a corrupted file copier though and not really built for speed so it’s still a valuable tool
to have around, especially the portable version.

What the test does show on the whole is that for copying large files between drives Windows
keeps up with the 3rd party tools and you won’t get much of a speed boost. Where you do
gain though, is in the extra functions like pause / resume, handling copy failures and queuing
etc. For copying lots of smaller files many of these tools do make a great deal of sense with
their improved caching and algorithms which really can make a sizable difference in transfer
times.

Although this isn’t a definitive test it does at least show how well or badly Windows and
several other tools perform in common scenarios most of us are likely to encounter quite
often. These tests should give you a better idea what free copying tools may be more suited to
your needs…

All visitors to this page (and the editor) should closely read shannf and ludoviclalo's
comments re terracopy. It is a wonderful program for SIMPLE, SMALL copy jobs,
unfortunately it errors on anything else. I say this as a user for many years.

Like ludoviclalo I found my backups weren't true and correct. As ludoviclalo says terracopy
simply cannot handle copying anything with a full path longer than 255 characters (note the
path is just not the immediate directory or sub directory it is the full location detail after drive
letter:/ for eg E:/wombles/widgets/woebegone/ whatnext/etc etc etc). I did find it would detail
those files it was unable to copy at the end of the job BUT there was no way to sort that file
list of done/not done that you receive and when you were copying thousands of files it
becomes a needle in a haystack to find all the errors. I also wholely agree with shannf,
Terracopy cannot handle a huge job of many files and a large GB size. It will crash more
often than not.

Reemphasise, I really like(d) terracopy but it is simply not a viable 100% every time copying
program and should not be the number one pick.

I ended up using fastcopy and also a Microsoft free utility called robocopy. Note with the
latter the Microsoft program involves using the command prompt. There are 3rd party addons
that promise a GUI.
Unfortunately it is a while since I did my last major copy job so I can't be specific but I do
remember both Fastcopy and robocopy were not as friendly to use as terracopy. Would
suggest doublechecking any big job using either program to make sure they have copied "the
lot".

10 best free fast File Copy software for Windows 10 PC


One of the most common of functions on Windows systems is cut, copy, and paste. The
easiest way to do so is to drag the file across folders or use keyboard shortcuts to perform the
functions – Cut-CTRL+X, Copy-CTRL+C, Paste-CTRL+V. Copying speed depends largely
on the media the files are being transferred through. It is advisable to use USB 3.0 ports for
copying since the copy-speed is basically the lowest of whatever is permitted by the cables,
devices, media, and protocols.

The usual file copying procedure in Windows has two issues – the copy-speed and the fact
that halting the process in between makes it difficult to resume it from the same stage. While
we can fix slow file copy speed in Windows using some tips, if you are looking for a free fast
File Copy software for Windows PC, then this list will interest you.

1] TeraCopy

TeraCopy is a feature-rich copy-paste tool. The design is smart. It copies the files through the
fastest channel and skips problematic files. At the end of the process, the software prompts
whether the user wishes to copy the files skipped earlier or not. TeraCopy can be incorporated
into Windows Explorer’s right-click menu as well. This awesome software allows pausing the
copy process anywhere in between and resuming it at your will. The copy speed is much
better than Windows, and it has a smart error recovery process.

2] Fast File Copy


The Fast File Copy software opens up a window which segregates into two sections, thus
making it easier to select the source and destination folder for file transfer. Simply select the
files on the left side and the destination folder on the right side and initiate the transfer. The
best part about FastFileCopy is the speed. The transfer rate of the software is much better than
the original transfer rate of Windows. Users can also open File Explorer from the software
itself.

3] File Fisher

The File Fisher software is probably the most versatile of file copy software products. It is
fully customizable and can be carried in a USB to be used instantly wherever needed. You can
pause, resume, or cancel the copy process any second, and re-initiate the process from the
exact point where you stopped it. The best part about File Fisher is that it preserves the file
structure.

4] Ultracopier
Ultracopier is another file copy software worthy of this list. The free product has an amazing
file copy speed. You could set the controls such that files with similar names could be
downloaded with a set policy, be it renaming the duplicate file or defying the
transfer. Ultracopier would present you with an error log after the copying is done.

5] Dabel File Mover


The easiest software in this list is Dabel File Mover. It has a pretty simple, yet powerful
interface. Simply browse the file or folder from the source and select the destination. Start
copying after that. The same could be done for multiple sources and destination folders. The
best part is that Dabel File Mover doesn’t require any installation. You could start using it
from the folder directly.

6] ExtremeCopy

While ExtremeCopy has two versions, free and paid, the free one is yet better than the
original Windows file-copying facility. The free version offers the option to pause, skip, and
verify the copying process. It is faster than the original file transfer process in Windows. You
could download the freeware from here.

7] CopyHandler

The CopyHandler software has two options, one is using it in the standard window and the
second is the detailed version which displays extensive transfer data. CopyHandler comes
with pause and resumes options to control the copy-paste process. It is available on the
developer’s website here.

8] NiceCopier

NiceCopier is a light software which calculates the best channel for file-copying in your
Windows system and uses it for the transfer process. The freeware allows you to pause and
resume the transfer process at your will. It could be an excellent substitute for Windows
Explorer. If you like it, check more on its website here.

9] Microsoft Richcopy

While many software products are available online, anything that is approved by Microsoft
and is available on its official website has a thing of its own. The RichCopy tool allows users
to make multiple profiles for using it. It has a better copy speed than the original Windows
function and supports command lines. You could pause or resume the process at any stage.
The software is available on Microsoft Technet.
10] SuperCopier

The SuperCopier software is integrated with Windows Explorer and is much faster than the
default Windows copying utility. It allows you to pause the copy process anywhere in
between and resume it from the same stage. It can be downloaded from here.

Let us know if we could add anything to this list in the comments section below.

Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP Awardee in


Windows (2006-16) & a Windows Insider MVP. Please read the entire post & the comments
first, create a System Restore Point before making any changes to your system & be careful
about any 3rd-party offers while installing freeware.
report this ad

Das könnte Ihnen auch gefallen