ArticleslgStudy

science

Robocopy

Robocopy is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Robocopy rather than just read about it. In short: Robocopy is a command-line file transfer utility for Windows. It is functionally more comprehensive than the COPY and XCOPY commands, but replaces neither.

Key takeaways

  • Robocopy belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Robocopy to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Robocopy from memory before moving on to harder problems.

Reference excerpt

Robocopy is a command-line file transfer utility for Windows. It is functionally more comprehensive than the COPY and XCOPY commands, but replaces neither. Created by Kevin Allen and first released as part of the Windows NT 4.0 Resource Kit, it has been a standard feature of Windows since Windows Vista and Windows Server 2008.

Features Robocopy provides features not in the COPY and XCOPY commands, including:

Recovering from temporary loss of network connectivity; incomplete files are marked with a date stamp of 1970-01-01 and contain a recovery record so Robocopy knows where to continue from Detecting and skipping NTFS junction points, which, under certain circumstances, may cause copying failures because of infinite loops (with the /XJ switch) Preserving any combination of the following: file contents, attributes, metadata (e.g. original timestamps), and NTFS ACLs (DACLs, SACLs, and owner) For example, copying ACLs from one file to another; before version XP026, this capability was limited to files only, not folders Utilizing the Windows NT "Backup Files and Directories" privilege (SeBackupPrivilege, normally not available to standard user accounts) to bypass NTFS ACLs that would otherwise impede transfer (requires the /B switch) Persistence by default, with a programmable number of automatic retries if a file cannot be copied The mirror mode, which keeps two directory trees synchronized by also deleting files in the destination that are not present in the source Skipping files already in the destination folder with identical size and timestamp Progress indicator Support for paths exceeding 259 characters, up to a theoretical limit of about 32,000 characters Result code indicating success or failure; used in automation Multithreaded copying (introduced with Windows 7 and Windows Server 2008 R2) Support for server message block (SMB) compression (introduced with Windows 10 and Windows Server 2019) If /compress is specified, the destination computer supports SMB compression, and the files being copied are compressible, the operation enjoys significant performance improvements

Use Robocopy syntax is markedly different from its predecessors, copy and xcopy, in that it accepts only folder names, without trailing backslash, as its source and destination arguments. File names and wildcard characters (such as * and ?) are not valid as source or destination arguments. Files may be selected or excluded using the optional file filtering argument (which supports wildcards) along with various other options. The files named are copied only from the folder selected for copying. Fully qualified path names are not supported. Per normal operation in Windows, command name matching is case insensitive, if more than one option is specified, they must be separated by whitespace and if a directory name contains a special character, such as whitespace, it must be enclosed in double quotes. Robocopy reports the name of each directory encountered, in alphabetical order. Each name is preceded by the number of files in the directory that fulfill the criteria for being copied. If the directory does not yet exist in the target, it is marked "New Dir"; if the directory is empty and the /E option is not used, or it contains no files meeting the criteria, a new directory will not be created. If the /NFL (no file names in log) option is not used, the files being copied will be listed after the name of the directory they are in. At the end of the output is a table giving numbers of directories, files, and bytes. For each of these, the table gives the total number found in the source, the number copied (including directories marked "New Dir" even if they are not copied), the number skipped (because they already exist in the target), and the number of mismatches, FAILED, and extras. "Failed" can mean that there was an I/O error that prevented a file being copied, or that access was denied. There is also a row of time taken (in which the time spent on failed files seems to be in the wrong column).

Bandwidth throttling The inter-packet gap (IPG) option allows some control over the network bandwidth. In theory, the following formula expresses the delay (D, in milliseconds) required to simulate a desired bandwidth (BD, in kilobits per second), over a network link with an available bandwidth of BA kbps:

D=BA−BDBA×BD×512×1000 In practice however, experimentation is usually required to find a suitable delay, due to factors such as the nature and volume of other traffic on the network. The methodology employed by the IPG option may not offer the same level of control provided by some other bandwidth throttling technologies, such as BITS (which is used by Windows Update and BranchCache).

Limitations Does not copy open files A process can lock a file for exclusive read access. Normally, the volume shadow copy service is used for such situations, but Robocopy does not use it. Consequently, Robocopy is not suitable for backing up a live volume. However, utilities such as ShadowSpawn or DiskShadow (included with Windows Server 2008), can be used beforehand to create a shadow copy of a given volume, which Robocopy can then backup.

Versions on systems older than Windows Vista do not mirror properly They ignore changed security attributes of previously mirrored files.

Multithreaded progress When specifying the /MT[:n] option to enable multithreaded copying, the /NP option to disable reporting of the progress percentage for files is ignored. By default the MT switch provides 8 threads. The n is the number of threads you specify if you do not want to use the default.

Backup of root A long-standing issue with Robocopy is that if you backup from the root folder of a drive [ e.g., robocopy d:\ b:\d-backup\ ....], the destination files will be given attributes including SH. This means that they will be invisible to normal access (including DIR in cmd.exe). To fix this, add /a-:SH to the robocopy command line - or do an ATTRIB command to remove them afterwards.

Examples The following copies two files from folder c:\bar to c:\baz:

To copy all PDF files from c:\bar to c:\baz:

The following copies directory contents of Directory A to Directory B including file data, attributes and timestamps, recursively with empty directories (/E):

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Robocopy

Start with the simplest possible case. Write down what Robocopy claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Robocopy before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Robocopy ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Robocopy

In research
Robocopy appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Robocopy in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Robocopy is common in secondary-school and first-year university syllabi. It links to neighbouring topics File copy utilities, Windows commands, so understanding it makes those chapters shorter.
In everyday life
Look for Robocopy outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Robocopy” →

How to study Robocopy in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Robocopy means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Robocopy out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Robocopy in simple terms?

Robocopy is a command-line file transfer utility for Windows. It is functionally more comprehensive than the COPY and XCOPY commands, but replaces neither.

Why does Robocopy matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Robocopy?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Robocopy.

Tags

  • File copy utilities
  • Windows commands

Keep exploring