• Skip to main content
  • Skip to primary sidebar
  • Business
  • WordPress
  • Security
  • Marketing
  • Publicity
  • Computing
  • Resources
  • Whatevs

Purely Computing

Software, PCs, Macs, Consoles, Handhelds, & More

  • Home
  • About
  • Contact
  • Contribute

Using XCOPY to copy all files, including system and protected

Windows Command Prompt
xcopy C:\Users\YourUsername\AppData D:\DestinationFolder /O /X /E /H /K

Replace YourUsername with your actual Windows username and D:\DestinationFolder with the path to the destination folder where you want to copy the AppData folder.

Explanation of the switches used in the command:

  • /O: Copies file ownership and ACL information.
  • /X: Copies file audit settings (implies /O).
  • /E: Copies directories and subdirectories, including empty ones.
  • /H: Copies hidden and system files.
  • /K: Copies attributes. Normal Xcopy will reset read-only attributes.

Again, please exercise caution when copying system and protected files. It’s recommended to have a backup and ensure that you understand the consequences of copying such files. Additionally, running commands in the Command Prompt may require administrative privileges, so you may need to run the Command Prompt as an administrator.

by Jack Alltrade on February 21, 2025

Filed Under: Command Prompt Tagged With: Protected Files, System Files, XCOPY

Reader Interactions

Share Your Two Cents Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Categories

  • Command Prompt
  • Computing
  • DOS
  • Hardware
  • Software
  • Tech Terms
  • Windows

© Copyright Jack Alltrade & Associates 2025 · Purely Supplemental™ is a trademark of Jack Alltrade & Associates