Can I move files from nested folders with a single command?

badspell68

New member
Member
VIP
Local time
4:55 AM
Messages
231
Location
PA
Is it possible to move files from a location that has files contained in many folder of witch many are deeply nested in layers of other folders using a single command or some software tool? I would rather not spend hours copy and pasting files and trying to keep track of what I have moved.

Thank!
 

My Computer My Computer

OS
Windows 7
Any ideas?
 

My Computer My Computer

OS
Windows 7
You want to move 1 folder with many folders/files in it to another destination?
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
I think he wants to move, not copy.

There's a move command, but I don't see a switch for subdirectories like the copy command has.

I'm sure there is a semi-slick way of doing a move with all subdirectories, but it's beyond my knowledge level.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Ignatz Special; 4 speed manual gearbox; factory air conditioning; one of one
OS
Windows 7 Home Premium SP1, 64-bit
CPU
Intel Skylake i5-6600K, not overclocked
Motherboard
AsRock Z170M Extreme 4, micro ATX
Memory
8 GB HyperX DDR4-2666 (2 x 4 GB)
Graphics Card(s)
none; graphics are integrated on CPU
Sound Card
onboard: Realtek ALC1150; external: USB Behringer UF0-202
Monitor(s) Displays
Dell S2340M 23 inch IPS
Screen Resolution
1600 x 900
Hard Drives
System: Crucial MX100 series SSD, 128 GB;
Data: Samsung Spinpoint 103SJ, 1 TB;
Backup: WD Caviar Green WD30EZRX-00D8PB0, 3 TB
PSU
Rosewill SilentNight 500 watt fanless, semi-modular
Case
Antec Solo II
Cooling
Noctua NH-U12S; Noctua F12 intake, Noctua S12A exhaust
Keyboard
Microsoft 200 6JH-00001 USB
Mouse
Dell or Microsoft optical wired; USB
Antivirus
Microsoft Security Essentials and Malwarebytes Premium
Browser
Pale Moon
Other Info
All fans PWM; speeds at idle: CPU circa 500 rpm; intake circa 600 rpm; exhaust circa 600 rpm; CPU temps 27 idle and 47 C load in a warm room (27 C/81 F) when running Intel Extreme Tuning Utility stress test.
I think he wants to move, not copy.

There's a move command, but I don't see a switch for subdirectories like the copy command has.

I'm sure there is a semi-slick way of doing a move with all subdirectories, but it's beyond my knowledge level.
Just CUT the source and paste it somewhere alse. whnat's the problem of OP?
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
Just CUT the source and paste it somewhere alse. whnat's the problem of OP?

I don't know any more about his problem than you do.

Apparently, he wants a command line option rather than hand-selecting a bunch of files.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Ignatz Special; 4 speed manual gearbox; factory air conditioning; one of one
OS
Windows 7 Home Premium SP1, 64-bit
CPU
Intel Skylake i5-6600K, not overclocked
Motherboard
AsRock Z170M Extreme 4, micro ATX
Memory
8 GB HyperX DDR4-2666 (2 x 4 GB)
Graphics Card(s)
none; graphics are integrated on CPU
Sound Card
onboard: Realtek ALC1150; external: USB Behringer UF0-202
Monitor(s) Displays
Dell S2340M 23 inch IPS
Screen Resolution
1600 x 900
Hard Drives
System: Crucial MX100 series SSD, 128 GB;
Data: Samsung Spinpoint 103SJ, 1 TB;
Backup: WD Caviar Green WD30EZRX-00D8PB0, 3 TB
PSU
Rosewill SilentNight 500 watt fanless, semi-modular
Case
Antec Solo II
Cooling
Noctua NH-U12S; Noctua F12 intake, Noctua S12A exhaust
Keyboard
Microsoft 200 6JH-00001 USB
Mouse
Dell or Microsoft optical wired; USB
Antivirus
Microsoft Security Essentials and Malwarebytes Premium
Browser
Pale Moon
Other Info
All fans PWM; speeds at idle: CPU circa 500 rpm; intake circa 600 rpm; exhaust circa 600 rpm; CPU temps 27 idle and 47 C load in a warm room (27 C/81 F) when running Intel Extreme Tuning Utility stress test.
If you mean recursively copy files without duplicating the folder structure, into a destination folder, rcopy will do it if the destination folder exists.

It does a copy, not a move. But you could do it in two commands. Example: the command prompt is open with C:\MyFolder as current directory. You would use these commands to move all srt subtitles to C:\MySubs

rcopy *.srt C:\MySubs
del *.srt /s

Edit: Make sure the rcopy destination is not inside the source folder tree. Otherwise the del /s command will delete them from the dest folder.
 

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
( If some of you wonder why rcopy instead of just recursive copy, rcopy will skip the folder if the source and dest are the same. This enables copying to a dest in the source folder tree. I mainly wrote it to copy all subtitles to one folder for processing without deleting the originals. )
 

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Thanks for that Miles. I might be able to use that myself.

I assume you might have over-write issues if you had 2 files in separate folders that had the same name. Would that command overwrite, skip, or alter the name as necessary?

There's a freeware program out there called Suction (suction.exe) that supposedly moves files "flat", without copying the folder structure. I ran across it a month ago, but haven't tried it.

And I think it can be done from Powershell, but I don't know the command.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Ignatz Special; 4 speed manual gearbox; factory air conditioning; one of one
OS
Windows 7 Home Premium SP1, 64-bit
CPU
Intel Skylake i5-6600K, not overclocked
Motherboard
AsRock Z170M Extreme 4, micro ATX
Memory
8 GB HyperX DDR4-2666 (2 x 4 GB)
Graphics Card(s)
none; graphics are integrated on CPU
Sound Card
onboard: Realtek ALC1150; external: USB Behringer UF0-202
Monitor(s) Displays
Dell S2340M 23 inch IPS
Screen Resolution
1600 x 900
Hard Drives
System: Crucial MX100 series SSD, 128 GB;
Data: Samsung Spinpoint 103SJ, 1 TB;
Backup: WD Caviar Green WD30EZRX-00D8PB0, 3 TB
PSU
Rosewill SilentNight 500 watt fanless, semi-modular
Case
Antec Solo II
Cooling
Noctua NH-U12S; Noctua F12 intake, Noctua S12A exhaust
Keyboard
Microsoft 200 6JH-00001 USB
Mouse
Dell or Microsoft optical wired; USB
Antivirus
Microsoft Security Essentials and Malwarebytes Premium
Browser
Pale Moon
Other Info
All fans PWM; speeds at idle: CPU circa 500 rpm; intake circa 600 rpm; exhaust circa 600 rpm; CPU temps 27 idle and 47 C load in a warm room (27 C/81 F) when running Intel Extreme Tuning Utility stress test.
There's a /n switch for no overwite. Run with no params it shows a usage dialog. Also it has a sanity check. If the total files to copy are > 128 it prompts to continue. See included Readme.txt.
 

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
I'm looking to "COPY" all "files" from multiple folders of a HD (some of the folders also have sub-folders) to a USB thumb drive so that all the files, no folders, reside on the thumb drive.
 

My Computer My Computer

OS
Windows 7
Get a tool like XXCOPY
http://www.xxcopy.com/index.htm

Use it to copy all the files to a single directory

eg
xxcopy source destination /s /sx
This would copy all files from the source, including subdirectories into a
single directory (destination)
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
I'm looking to "COPY" all "files" from multiple folders of a HD (some of the folders also have sub-folders) to a USB thumb drive so that all the files, no folders, reside on the thumb drive.

If X: is the thumb drive and you want to copy to the root you could do like

for %s in (c:\folder1 d:\foldera\folderb c:\yuk) do rcopy /n %s\*.* X:\

unzip rcopy.zip to a folder in your path so you can rust type rcopy without the full path.

/n just means do not overwite if a destination file has the same name. See included Readme.txt

Edit: you could use a tool like RichCopy or xcopy or robocopy but for this you don't have to mess with switches(except for /n) as rcopy is always recursive.
 

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
With Xcopy how would I copy all files from the souse, regardless of what folders or sub-folders they are in, to one source?

And how would I do this with richcopy?
 

My Computer My Computer

OS
Windows 7
I don't know how to do that (or if it can be done) with xcopy without duplicating the folder structure.

But you can do it with xxcopy that is downloadable from Kaktussoft's link in post 12.

This command:

xxcopy /sr d:\temp d:\test

will copy all files from D temp to D test and omit the folder structure. The r in the command appends the name of the source folder to the right edge of the file on the destination, to avoid over-writing files in the source directory tree that happen to have identical file names.

So, a file named dog.jpg within the animals folder under D temp will be renamed to dog.jpg`animals on D test. And a file named dog.jpg within the pets folder on D temp will be renamed to dog.jpg`pets on D test. Otherwise, you'd either over-write or skip the second dog.jpg file if copying to a single folder.

You can later run xxcopy source destination /srr to reconstruct the folder structure if necessary.

If you change the command to

xxcopy /s d:\temp d:\test

the folder structure will be included.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Ignatz Special; 4 speed manual gearbox; factory air conditioning; one of one
OS
Windows 7 Home Premium SP1, 64-bit
CPU
Intel Skylake i5-6600K, not overclocked
Motherboard
AsRock Z170M Extreme 4, micro ATX
Memory
8 GB HyperX DDR4-2666 (2 x 4 GB)
Graphics Card(s)
none; graphics are integrated on CPU
Sound Card
onboard: Realtek ALC1150; external: USB Behringer UF0-202
Monitor(s) Displays
Dell S2340M 23 inch IPS
Screen Resolution
1600 x 900
Hard Drives
System: Crucial MX100 series SSD, 128 GB;
Data: Samsung Spinpoint 103SJ, 1 TB;
Backup: WD Caviar Green WD30EZRX-00D8PB0, 3 TB
PSU
Rosewill SilentNight 500 watt fanless, semi-modular
Case
Antec Solo II
Cooling
Noctua NH-U12S; Noctua F12 intake, Noctua S12A exhaust
Keyboard
Microsoft 200 6JH-00001 USB
Mouse
Dell or Microsoft optical wired; USB
Antivirus
Microsoft Security Essentials and Malwarebytes Premium
Browser
Pale Moon
Other Info
All fans PWM; speeds at idle: CPU circa 500 rpm; intake circa 600 rpm; exhaust circa 600 rpm; CPU temps 27 idle and 47 C load in a warm room (27 C/81 F) when running Intel Extreme Tuning Utility stress test.

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Last edited:

My Computer My Computer

OS
Windows 7
move %USERPROFILE%\AppData\Roaming\Mozilla S:\Users\%USERNAME%\AppData\Roaming\Mozilla

I want to run this command but the destination directory and path doesn't exist. I want to create it by cmd but I want to move only files and folders in "Mozilla" folder. Is it possible?

It is a useful way to keep write down to a SSD. I'm going to use it along with those commands:
mklink /j %USERPROFILE%\AppData\Roaming\Mozilla S:\Users\%USERNAME%\AppData\Roaming\Mozilla
mklink /j %USERPROFILE%\AppData\Local\Mozilla S:\Users\%USERNAME%\AppData\Local\Mozilla
 

My Computer My Computer

Computer Manufacturer/Model Number
Sony Vaio
OS
Windows 7 Home premium x64
CPU
Intel i5 520m at 2.4GHz(plus turbo mode at 2.9GHz)
Memory
4GB ddr3 1067
Graphics Card(s)
Nvidia 330m
Why not just move the Mozilla folder and execute the junction command?
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
I need to do it by cmd because I want to do it in many pc's with SSD. I want a practical and automatic way to do it because It cost me more time.

Also the script I'll make will be executed for every new user that it is created in each pc.
 

My Computer My Computer

Computer Manufacturer/Model Number
Sony Vaio
OS
Windows 7 Home premium x64
CPU
Intel i5 520m at 2.4GHz(plus turbo mode at 2.9GHz)
Memory
4GB ddr3 1067
Graphics Card(s)
Nvidia 330m
Back
Top