PDF download Download Article PDF download Download Article

Whether you're unable to boot into Windows or just want to learn new ways to manage files, you can use the Command Prompt to copy data from your hard drive to your flash drive. If you're just copying individual files, you can use the copy command. But if you want to copy an entire folder, including any subfolders and files inside, the xcopy command is a better option. This wikiHow teaches you how to use both copy and xcopy to copy files and folders at the Windows Command Prompt.

Copying Files to USB with Windows Command Prompt

  1. Open the Command Prompt.
  2. Find the drive letter of your USB flash drive.
  3. Create a new folder in your flash drive if you'd like to.
  4. Enter the folder location that contains the files you want to copy.
  5. Use the "copy" command to copy individual files.
  6. Use the "xcopy" command to copy an entire folder.
  1. If you haven't already done so, here's how you can access your Windows command prompt:[1]
    • Press Windows key + S to activate the search bar.
    • Type cmd into the search bar.
    • If you need to copy system files, right-click Command prompt and select Run as administrator.
      • You don't have to do this if you're booted into recovery mode, as the Command Prompt will always run as an administrator this way.
    • If you're copying personal files, like your own pictures or documents, just click Command prompt.
  2. If you already know the letter assigned to the drive (e.g., E or F), you can skip this step. If not, here's how to find it:
    • Type or paste this command after the prompt: wmic logicaldisk where drivetype=2 get deviceid, volumename, description
    • Press Enter.
    Advertisement
  3. If you want to copy files to a specific folder rather than the root of your flash drive, you can create one at the command prompt. Here's how:
    • Type cd F: (if your flash drive isn't F:, replace it with your drive letter}} and press Enter.
    • Type mkdir foldername and press Enter (replace foldername with the name you want to give the new folder).
  4. For example, if you want to copy the contents of your personal Documents folder, you can enter that folder by typing cd C:\Users\yourname\Documents.[2]
    • If there's a space in the name of the folder, such as C:\Users\yourname\rough drafts, you'll need to place the entire path in quotes like this: cd "C:\Users\yourname\rough drafts.
    • To see all the files inside of a folder, type dir and press Enter.
    • Type dir and press Enter to see existing files and folders. All folders are labeled with ''<DIR>'', which tells you that these are folders instead of files.
  5. If you want to copy just one file (no folders) onto your USB drive, it'll be easiest to use the copy command to do so. Here's how:
    • When you use the copy command, you'll use it like this: copy source destination. For example, to copy a file called cats.docx from your current directory to a folder called Pets on your USB flash drive that's assigned the F: drive letter, you'd do this:
      • copy cats.docx F:\Pets\
    • If you want to copy multiple individual files at once that end with the same file extension (e.g., .docx to the Pets folder on your flash drive, you'd type copy *.docx F:\Pets\).[3]
  6. If you're backing up an entire folder to your flash drive or otherwise need to copy multiple files, xcopy does a great job at that. For example, let's say you want to copy the entire folder C:\Users\yourname\rough drafts, including all of the files and folders inside of it, to the F drive. You'd use:[4]
    • xcopy "C:\Users\yourname\rough drafts\" F:\ /e /h /r
    • Notice the trailing backslash \ at the end of the first path—this tells xcopy that you're copying a folder, not an individual file.[5]
    • Adding /e tells xcopy to copy all sub-folders.
    • Including /h ensures that xcopy also copies hidden files.
    • Adding /r also includes any read-only files.[6]
  7. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Copy Files in Command PromptCopy Files in Command Prompt
Copy Documents to a USB Flash Drive from Your ComputerCopy Documents to a USB Flash Drive from Your Computer
Copy a Folder with Batch FileCopy a Folder with Batch File
Use the Command Terminal in Windows 10 to Move and Copy Files/Folders Use the Windows 10 CLI to Move & Copy Files or Folders
Use MS DOS Use MS DOS
Copy Files to an External Hard Drive Copy Files to an External Hard Drive: Quick & Easy Steps
Open a Folder in Cmd Open a Folder in Command Prompt (CMD)
Write a Batch FileWrite a Batch File
Copy Files in Linux Copy Files in Linux: A Complete Guide
Navigate the Windows DirectoryNavigate the Windows Directory
Transfer Data from a Flash Drive to a Computer Transfer Data From a Flash Drive to a Windows or Mac PC
Put Pictures on a Flash DriveTransfer Photos to a USB Flash Drive on Windows & Mac
Copy a Directory Linux Copy a Directory with the cp Command on Linux
Change Directories in Command Prompt Navigate to a Different Folder in the Command Prompt
Advertisement

About This Article

Nicole Levine, MFA
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 144,200 times.
How helpful is this?
Co-authors: 6
Updated: April 22, 2025
Views: 144,200
Categories: Command Prompt
Article SummaryX

1. Open the Command Prompt as an administrator if copying system files.
2. Use the "copy" command to copy individual files.
3. Use the "xcopy" command to copy entire folders and their contents.

Did this summary help you?

Thanks to all authors for creating a page that has been read 144,200 times.

Is this article up to date?

Advertisement