Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Robocopy? Copy Directory Structure 1 level

23 Nov 2012   #1

Windows 7 Pro x64
 
 
Robocopy? Copy Directory Structure 1 level

I want copy a list of folders (a few hundred) to a new location. I tried using robocopy but can only get it to either copy the selected folder or all folders with subfolders. What I want is to only copy one level of folders and not the subfolders within.
Example:
C: Drive (the source)
->Clients
->Client 1
->Order1
->More SubFolders
->Order2
->Order3
->Order4
->Client 2
->Order1
->Order2
->Order3
->Order4
->Client 3
->Client 4
So I would want to copy over just the first level of folders (the list of clients), but none of the subfolders within each client folder.

any help would be great.
thanks.

My System SpecsSystem Spec
.

23 Nov 2012   #2

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64 Ubuntu 12.04 LTS Tri-Boot
 
 

Hi,

Try using the /LEV:n switch in your robocopy command.

From robocopy /? at command prompt
Code:
::
:: Copy options :
::
                 /S :: copy Subdirectories, but not empty ones.
                 /E :: copy subdirectories, including Empty ones.
             /LEV:n :: only copy the top n LEVels of the source directory tree.
It should look similar to this:

Code:
robocopy C:\Clients G:\Backup\Clients /LEV:2
Perform some tests to make sure it works OK.

Regards,
Golden
My System SpecsSystem Spec
24 Nov 2012   #3

Windows 7 Pro x64
 
 

Perfect!
I used
Quote:
robocopy "C:\Clients" "D:\Clients" /e /LEV:2 /XF "*.*"
without the "/xf [filname]" it was copying over all files as well, I just wanted the folders.
Thanks again!
My System SpecsSystem Spec
.


24 Nov 2012   #4

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64 Ubuntu 12.04 LTS Tri-Boot
 
 

No worries. Glad it worked OK for you.
My System SpecsSystem Spec
Reply

 Robocopy? Copy Directory Structure 1 level





Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:32 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33