Manage XCopy With The Command Prompt / PowerShell

Edward Snowden
Edward Snowden Last Updated: May 18, 2022


Software: Windows 7, 8 & 10 | Last modified on 2018-06-18


A guide to copying folders and files using the Command Prompt or PowerShell.

Copy specific folders & files


  1. Open the Command Prompt (Admin) or PowerShell (Admin).

  • Execute xcopy Source/File.txt Destination/File.txt to copy a single file to a new location.
    Example: xcopy C:\Users\Documents\File.txt D:\Backup\Documents\File.txt

  • Execute xcopy Source Destination to copy a folder without the sub-folders to a new location.
    Example: xcopy C:\Users\Documents D:\Backup\Documents

  • Execute xcopy Source Destination /S /I to copy a folder including all sub folders.
    Example: xcopy C:\Users\Documents D:\Backup\Documents /S /I

  • Execute xcopy Source Destination /S /I /H to copy a folder including all sub folders and hidden system folders.
    Example: xcopy C:\Users\Documents D:\Backup\Documents /S /I /H

  • Execute xcopy Source Destination /S /I /R to copy a folder including all sub folders while removing the read-only attributes.
    Example: xcopy C:\Users\Documents D:\Backup\Documents /S /I /R

  • Execute xcopy Source Destination /S /I /O to copy a folder including all sub folders while maintaining all existing permissions.
    Example: xcopy C:\Users\Documents D:\Backup\Documents /S /I /O

  • Execute xcopy Source Destination /D:m-d-y to copy files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
    Example: xcopy C:\Users\Documents D:\Backup\Documents /D:03-31-2000



Edward Snowden
Written by

Edward Snowden

Edward Joseph Snowden is an American whistleblower who copied and leaked highly classified information from the National Security Agency (NSA) in 2013 when he was a Central Intelligence Agency (CIA) employee and subcontractor. His disclosures revealed numerous global surveillance programs, many run by the NSA and the Five Eyes Intelligence Alliance with the cooperation of telecommunication companies and European governments, and prompted a cultural discussion about national security and individual privacy.


0 ratings

Related articles