Solved Copy a group of folders but only 1 subfolder

petebaldwin

New member
Local time
7:18 AM
Messages
2
I have a large group of 3000 folders and in them, there are the seletion of subfolders as shown below.

Property 1
-Gas
-Electric
-Asbestos

Property 2
-Gas
-Electric
-Asbestos

etc

I need to create a CD containing all Gas information so I was hoping to find a way of copying the folders so that the root folders, "Property 1", "Property 2" etc are still there but only contain the Gas subfolder.

The only way I know of is to copy the whole thing somewhere else and delete the subfolders I don't want but I don't have the hard drive space - the above list is a simplified version!

Many thanks in advance.

Pete
 

My Computer My Computer

At a glance

Windows 7
Computer type
PC/Desktop
OS
Windows 7
Since this is a custom thought process, you'll need to script it.
 

My Computer My Computer

At a glance

Windows 10 x64Intel i5-3570KCrucial 16GBnVidia Geforce 660 GTX
Computer type
PC/Desktop
OS
Windows 10 x64
CPU
Intel i5-3570K
Motherboard
Asus Maximus V Gene
Memory
Crucial 16GB
Graphics Card(s)
nVidia Geforce 660 GTX
Sound Card
onboard
Monitor(s) Displays
NEC 2490WUXi2
Screen Resolution
1920x1200
Hard Drives
Crucial M4 256GB
PSU
Corsair 650TX
Case
Fractal Design - Define Mini
Keyboard
Filco Majestouch Tenkeyless Black MX
Mouse
Logitech MBJ58
Are there files in the root directory, i.e. Property 1?

You can try xcopy, it may do what you need. Something like:

xcopy "\Property 1\Gas\*.*" "\targetdirectory" /e

Edit: You could also try robocopy with the /xd <Directory>[ ...] parameter.

/xd excludes directories that match the specified names and paths. That way you could do a full copy and exclude the sub-directories you don't want.
 

My Computer My Computer

At a glance

Windows 10 Pro X64Intel Quad Core i7-4770 @ 3.4Ghz16.0GB PC3-12800 DDR3 SDRAM 1600 MHzIntel Integrated HD Graphics
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Robocopy.... awesome! Did the job perfectly. Many thanks!
 

My Computer My Computer

At a glance

Windows 7
Computer type
PC/Desktop
OS
Windows 7
Great, glad it worked. Thanks for letting me know.
 

My Computer My Computer

At a glance

Windows 10 Pro X64Intel Quad Core i7-4770 @ 3.4Ghz16.0GB PC3-12800 DDR3 SDRAM 1600 MHzIntel Integrated HD Graphics
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Back
Top