Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Copying Folders In Dos


  • Please log in to reply
3 replies to this topic

#1 okie1211

okie1211

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:02:51 AM

Posted 24 February 2007 - 01:25 PM

hey folks, hopefully this is a simple one for you all, i'm new to DOS/command line interface after creating a directory how can you copy it to another drive for example can you copy one folder and its contents from c drive to d drive (c:\newfolder1\newfolder2\newfolder3\ can you copy newfolder3 to d:\)if so what command should i use?

BC AdBot (Login to Remove)

 


#2 arcman

arcman

  • Members
  • 706 posts
  • OFFLINE
  •  
  • Location:Michigan
  • Local time:02:51 AM

Posted 24 February 2007 - 02:33 PM

If you want to copy over a directory along with all of its subdirectories, the xcopy command is what you want. Say you have C:\Backup and it has folders within it like \pictures, \music, etc., and you want to copy all of its contents over to D:\ Through DOS you use XCOPY [source] [destination] [and desired switch options] In this case we want the subdirectories copied along with the base folder, so we would use the /S switch, (and possibly the /E switch if you want to also copy any empty subdirectories). So in this case you would first make another Backup folder in D:\. So: MKDIR D:\Backup
Then the command to copy would be: XCOPY C:\Backup D:\Backup /S

For more on XCOPY go to the command prompt and type in XCOPY /?
Posted Image

#3 okie1211

okie1211
  • Topic Starter

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:02:51 AM

Posted 24 February 2007 - 02:47 PM

thanks, i wasn't aware that you had to create the folder on the new drive before you can copy it i thought it would work similar to cut and paste, thanks for your help

#4 Zidane5

Zidane5

  • Members
  • 1 posts
  • OFFLINE
  •  
  • Local time:09:51 AM

Posted 14 September 2009 - 04:33 PM

sorry 2 revive this old topic, but i have the same issue !
I noted that the Xcopy command copies the contents of the folder without the folder itself ! why is this ?
although if there were sub-folders they would be copied as they are (the same hierarchy )
tnx 4 u..





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users