# How do I copy a folder from one hdd to another in cmd?



## Bigfatbiffta (Apr 24, 2007)

Basically as the title says, i need to copy a folder from one partition on my hdd to the other, i dont know much about cmd prompt so i could do with the line i need to type.

I just need to copy from C:\Documents and settings\users\rich\desktop\'folder name'

to d:\

Thanks!


----------



## TheOutcaste (Aug 8, 2007)

*Xcopy* would be better for a folder.
I'm assuming you really mean C:\Documents and Settings\rich\Desktop. You can use %userprofile% to specify the current user's profile folder, so this will copy *folder name* from the desktop to drive *D:*

```
Xcopy /CEH "%Userprofile%\Desktop\folder name" D:\
```
You can type *Help* at the prompt for a list of commands.
Type the command followed by */?* for syntax and a brief description. *Copy /?* or *Xcopy /?*

Search *Help and Support* for *Command Line Reference* for more info as well


----------



## Bigfatbiffta (Apr 24, 2007)

Hi, thanks for the quick reply. The file path according to cmd prompt is "C:\Users\Rich\Desktop\D" (dont be confused by the 'D' - thats the name of the folder i want to move)

However when i try and copy it i get file not found?


----------



## TheOutcaste (Aug 8, 2007)

That path would be for Vista or Win 7, not the XP version your PC specs shows. Which OS are you running?

My bad, the above would only copy the files in the folder, not the folder itself.
Either one of these should work:

```
Xcopy /CEH "%Userprofile%\Desktop\D" D:\D\
Xcopy /CEH "C:\Users\Rich\Desktop\D" D:\D\
```
If the D folder is empty, you'll get the file not found message, as there is nothing to copy. In that case you need to use *MD D:\D* to create the empty folder on the D: drive


----------



## Bigfatbiffta (Apr 24, 2007)

Ok problem sorted, thanks very much and merry xmas


----------



## TheOutcaste (Aug 8, 2007)

You're Welcome, and Merry Christmas to you and yours!

If your issue has been resolved you (and ONLY you) can mark this thread Solved by using the Mark Solved button at the Top Left of this thread (above the first post) 










Jerry


----------

