Re: Copy the outer folder?
- View Source--- In email@example.com, "velagamma" <velagamma@...> wrote:
>Your question isn't entirely clear but what I think you're asking is whether you can create the parent or "base directory" name in the destination when you specify a directory to copy. The answer is yes and there's 3 ways you can do it.
> Is there a way to copy the outer folder, and not just the files and subfolders inside? E.g., if you're copying C:\Documents and Settings\Vela\Desktop\Project, is there a way to include the folder named Project, and not just the contents? Thank you.
1. Specify the name of the parent source directory in the destination path e.g.
xxcopy "C:\Documents and Settings\Vela\Desktop\Project\" dest\Project\
2. Use a wildcard to set the "base directory" a level (or more) higher than the source directory e.g.
xxcopy "C:\Documents and Settings\Vela\Desktop\Project*\" dest\
Note this method presumes that you can uniquely match the desired \Project\ directory when using a wildcard in \Project*\.
3. Use the \\ syntax to specify the base directory a level (or more) higher than the source directory e.g.
xxcopy "C:\Documents and Settings\Vela\Desktop\\Project\" dest\
See the end of http://www.xxcopy.com/xxtb_025.htm for a fuller explanation of the "base directory".