Solved Robocopy? Copy Directory Structure 1 level

andyMc

New member
Local time
3:09 PM
Messages
9
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 Computer

OS
Windows 7 Pro x64
CPU
AMD 955 Black
Motherboard
Asus M5a97 evo
Memory
Cosair Vengance
Monitor(s) Displays
Eizo 24"
Case
HAF 912
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Golden Mk. I.4
OS
Windows 10 Pro x64 ; Xubuntu x64
CPU
Intel i7 860 @ 2.80 GHz O/C'ed to 4.0GHz
Motherboard
Gigabyte P55A-UD3R Rev.1. Award BIOS F13
Memory
16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24)
Graphics Card(s)
EVGA NVidia GTX 560 1024MB
Sound Card
Realtek Integrated
Monitor(s) Displays
Dual Samsung SyncMaster 2494HS
Screen Resolution
1920*1080 and 1920*1080
Hard Drives
1*Samsung 840 EVO 120GB SSD;
1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
1*Samsung F1 SpinPoint 1TB;
2*Western Digital 1TB External USB 3.0
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0
PSU
Thermaltake ToughPower QFan 750W
Case
Thermaltake Element S VK60001W2Z
Cooling
Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans
Keyboard
Logitech G110
Mouse
Logitech MX518
Perfect!
I used
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 Computer

OS
Windows 7 Pro x64
CPU
AMD 955 Black
Motherboard
Asus M5a97 evo
Memory
Cosair Vengance
Monitor(s) Displays
Eizo 24"
Case
HAF 912
:thumbsup: No worries. Glad it worked OK for you.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Golden Mk. I.4
OS
Windows 10 Pro x64 ; Xubuntu x64
CPU
Intel i7 860 @ 2.80 GHz O/C'ed to 4.0GHz
Motherboard
Gigabyte P55A-UD3R Rev.1. Award BIOS F13
Memory
16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24)
Graphics Card(s)
EVGA NVidia GTX 560 1024MB
Sound Card
Realtek Integrated
Monitor(s) Displays
Dual Samsung SyncMaster 2494HS
Screen Resolution
1920*1080 and 1920*1080
Hard Drives
1*Samsung 840 EVO 120GB SSD;
1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
1*Samsung F1 SpinPoint 1TB;
2*Western Digital 1TB External USB 3.0
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0
PSU
Thermaltake ToughPower QFan 750W
Case
Thermaltake Element S VK60001W2Z
Cooling
Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans
Keyboard
Logitech G110
Mouse
Logitech MX518
Back
Top