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
andyMc

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
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

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
andyMc

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
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

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

 Robocopy? Copy Directory Structure 1 level




Thread Tools





Similar help and support threads
Thread Forum
Robocopy /MOV command copying but not deleting from source directory
Hi All, I have one folder A and have another folder B in the same drive E: I need to move all the content from folder A which are more than 2 years old to folder B. Hence when I ran the robocopy it just copied and I lost all disk space in drive E. My question is even though I used /MOV...
General Discussion
Need to return to the default Windows 7 directory structure
I don't know how I managed it, but I have completely disordered my Windows 7 directory structure. Whereas the default structure is to have the five distinct folders -- Favorites, Libraries, Homegroup, Computer, and Network -- I now have only two, Favorites and Desktop. Now, the Favorites consists...
General Discussion
Media players and directory structure
I have a set of CDs that provide audio and video samples for a text book. I've copies the CDs to a hard drive but the text refers to the samples by track number and there are no more "tracks" as such. Does the standard Windows copy build the directory entries in the same order as the tracks in...
Music, Pictures & Video
How to extract files _with_ keeping directory structure?
As a designer in the 90've done a lot of CDs and later DVDs of all my work. And as you know almost all of the files that he wrote a lot of space on your hard drive. For this amount of data backed up I was using compression first and then the ZIP RAR. And now, when BD is relatively cheaper than the...
Software
Update (copy) file to multiple places in directory structure
I have a directory structure root 1 sida 0002-A.xlp 2 sida 0002-A.xlp ...
General Discussion
Strange File Structure on Top level of OS Drive.
Does something seem odd with this file structure? There's a ton of files listed in the top level directory that I would normally think should be down in the Windows level. The view here is with hidden files and folders OFF. I recently had an infection located in this same folder with a...
Software

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 12:14.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App