Results 1 to 5 of 5

Thread: Using XCOPY when directory has a space in name

  1. #1
    Join Date
    Nov 2009
    Posts
    153

    Using XCOPY when directory has a space in name

    Hello people, I want your help in solving a small query of mine. I have been experimenting with xcopy command in command prompt and am stuck at one particular situation. I want to know how to copy the directories which have space in their names. Therefore if anybody knows the steps of Using XCOPY when directory has a space in name, then please suggest some. Thanks in advance.

  2. #2
    Join Date
    May 2008
    Posts
    335

    Re: Using XCOPY when directory has a space in name

    I dont think it is possible to use xcopy command when the name of the directory contains a space in it. Ms DOS does not support directories having space in their name as it is considered as a Junk character in DOS. You can rename the directory and remove the space from the name of the directory. Once the space from the name is removed, you can use the xcopy command to copy the directory from one location to the other location without any problems.

  3. #3
    Join Date
    Nov 2009
    Posts
    153

    Re: Using XCOPY when directory has a space in name

    Thanks for replying to the post really fast. As suggested I renamed the directory which I wanted to copy from one location to other and removed the unnecessary space from the name. I used the xcopy command and then copied the folder from one drive to other, it worked but the sub folders of the main folder were not copied to the new destination folder. Is there any special command to be entered to copy the subfolders?

  4. #4
    Join Date
    May 2008
    Posts
    335

    Re: Using XCOPY when directory has a space in name

    Yes the basic xcopy command when used will only copy the contains of the parent folder and will not copy the sub folders of the parent folder. That is the reason why the sub folders are not copied to the destination folder. You will have to modify the command to copy the subfolders to the destination folder. In the command prompt type the following command to copy the sub folders of the parent folder "Xcopy /s Source Destination" and then hit enter. /s helps in copying all the subfolders of the parent folder to the destination folder.

  5. #5
    Join Date
    May 2008
    Posts
    317

    Re: Using XCOPY when directory has a space in name

    There is another way in which the xcopy command can be used to copy the directories which have space in their names. Put the source and the destination in quotes while entering the command. This will help in copying the contains of the source folder to the destination folder. You can create a Batch file which will help you in copying the contains of the folder from one drive to the other. In the batch file which you will create, enter the following code :-
    Code:
    Xcopy /s "Source:\folder name" "Destination:\Folder name"
    Hope this solves your query.

Similar Threads

  1. How to avoid the "FILE or Directory" message in Xcopy
    By Channing in forum Operating Systems
    Replies: 3
    Last Post: 31-03-2010, 12:46 PM
  2. I am not able to do xcopy in DOS
    By LaTrell in forum Operating Systems
    Replies: 6
    Last Post: 28-01-2010, 08:16 PM
  3. what is different between xcopy and copy
    By Sabastiaan in forum Operating Systems
    Replies: 4
    Last Post: 23-01-2010, 03:19 AM
  4. How to run the Xcopy command on XP
    By Mansi gala in forum Operating Systems
    Replies: 3
    Last Post: 31-10-2009, 06:38 PM
  5. Running XCopy using AT command
    By Ian in forum Windows Server Help
    Replies: 8
    Last Post: 26-09-2007, 10:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,259,797.64010 seconds with 17 queries