Use Windows Explorer to copy a file/folder with its path structure

H

hmm

Suppose I want to copy a file or folder from C:\ to D:\, but with the same
folder path structure. For example, if I copy C:\MyFolder\MyFile.doc to D:\,
it should save to D:\MyFolder\MyFile.doc, creating MyFolder in D: if
necessary. If I copy C:\MyFolder\Songs\ to D:\, it should copy all files in
Songs\ to D:\MyFolder\Songs\, creating folders as needed. Perhaps the xcopy
command do it, but I prefer to drag/drop using Explorer.

How would I do it?
 
P

Pegasus \(MVP\)

hmm said:
Suppose I want to copy a file or folder from C:\ to D:\, but with the same
folder path structure. For example, if I copy C:\MyFolder\MyFile.doc to
D:\,
it should save to D:\MyFolder\MyFile.doc, creating MyFolder in D: if
necessary. If I copy C:\MyFolder\Songs\ to D:\, it should copy all files
in
Songs\ to D:\MyFolder\Songs\, creating folders as needed. Perhaps the
xcopy
command do it, but I prefer to drag/drop using Explorer.

How would I do it?

Drag c:\MyFolder to D:\.
 
H

hmm

Thanks Pegasus.

The action you propose will copy ALL files in MyFolder to D:\MyFolder. The
question is if only want to move a SINGLE FILE to D:, while retaining the
source file's path on C:.
 
B

Bob I

With Windows Explorer, you can't do as you propose. Xcopy with the /T /E
switches will.
 
P

Pegasus \(MVP\)

The strength of Explorer is its simplicity of operation. Its weakness is the
lack of flexibility. You need a command such as the one below to copy
individual files:

xcopy /s /y /c "c:\MyFolder\My File\SomeFile.doc" "d:\MyFolder\MyFile\"

It will create the required folders and subfolders on the fly. Note the
switches and the trailing backslash.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top