Robocopy is a powerful command-line tool used for copying and synchronizing files and directories. It is commonly used in Windows environments for tasks such as backup and migration. When running Robocopy, you may notice that it outputs dashed lines to indicate progress. While these lines can be helpful, they can also clutter the output and make it difficult to read. In this article, we will explore how to suppress the output of dashed lines in Robocopy.
Understanding Robocopy Output
Before we dive into suppressing the dashed lines, let's first understand the different types of output that Robocopy provides. When you run Robocopy, it displays various information about the copying process, including:
- File names and sizes
- Number of files copied
- Number of files skipped
- Elapsed time
- Progress percentage
- ETA (Estimated Time of Arrival)
All this information is useful for monitoring the progress and performance of the copy operation. However, the dashed lines that appear between each file can be distracting and unnecessary in some cases.
Suppressing Dashed Lines
To suppress the dashed lines in Robocopy output, we can use the /NJH (No Job Header) and /NJS (No Job Summary) options. These options remove the header and summary information, including the dashed lines, from the output.
Here's an example of how to use these options:
robocopy source destination /NJH /NJS
By adding these options to your Robocopy command, you will only see the essential information, such as file names, sizes, and progress, without the clutter of dashed lines.
Other Useful Robocopy Options
Robocopy provides a wide range of options to customize the copying process. Here are a few additional options that you may find useful:
/TEE: Displays the output on both the console and the log file./LOG:file: Writes the output to a log file instead of the console./R:n: Specifies the number of retries on failed copies. The default is 1 million./W:n: Specifies the wait time between retries in seconds. The default is 30 seconds./MIR: Mirrors a directory tree, deleting files in the destination that no longer exist in the source./XD dir: Excludes the specified directory from the copy operation.
These options can be combined with the /NJH and /NJS options to further customize the output of Robocopy.
Suppressing the output of dashed lines in Robocopy can make the output cleaner and easier to read. By using the /NJH and /NJS options, you can remove the header and summary information, including the dashed lines, from the output. Additionally, Robocopy provides a range of other options that allow you to customize the copying process to suit your needs.
References
| Reference | Description |
|---|---|
| Robocopy - Windows Server | Microsoft Docs | Official documentation for Robocopy command-line tool. |
| How-To Geek - The Best Ways to Sync Data Between Your PCs and Laptops | A guide to using Robocopy for syncing data between computers. |
| Windows Command Line - Robocopy Command Syntax and Examples | Provides examples and explanations of various Robocopy options. |