Copying Folders to the destination - command

August 18, 2011 at 12:01:18
Specs: Windows 7
Am trying to copy a folder to destination in command prompt programming - for eg: inside c:\daily i have 2 folders - test and test1 - i need to copy the entire folder structure to d:\testdaily. i tried XCOPY but it is not working as it copies only test and test1. Is there any way where i can copy the entire directory structure and place it in destination - here in the eg: After copying my d:\testdaily should contain daily folder which will in turn contain both the sub folders


See More: Copying Folders to the destination - command

Report •

August 18, 2011 at 12:03:39

Report •

August 18, 2011 at 12:07:41
i saw the XCOPY options but none has a way to copy the actual folder. It copies only the sub folders. Any thoughts?

Report •

August 18, 2011 at 12:16:28
Specifying whether Destination is a file or directory

If Destination does not contain an existing directory and does not end with a backslash (\), the following message appears:

Does destination specify a file name 
or directory name on the target 
(F = file, D = directory)? 

Press F if you want the file or files to be copied to a file. Press D if you want the file or files to be copied to a directory.

You can suppress this message by using the /i command-line option, which causes xcopy to assume that the destination is a directory if the source is more than one file or a directory.

I'm not seeing the problem here. Probably because you're not showing the problem.

How To Ask Questions The Smart Way

Report •

Related Solutions

August 18, 2011 at 19:49:41
The problem here is - In Source Folder i have lets say 3 folders 20110801.1, 20110801.2, 20110802. All these have sub folders. When i run a script i need to copy 20110801.1 and 20110801.2 to Destination folder. The logic is based on the input date. But when i use XCOPY it copies only files and subfolders from the 20110801.1 and 20110801.2 and at destination it just places it into root folder but i want the exact folder structure created. Thanks

Report •

Ask Question