Quickly Move All Files From Subdirectories To A Specific Path


Computer tasks are often mundane, but with a little knowledge about the command prompt or Powershell you can quickly move files from subdirectories to a specific path.

Moving Files In Subfolders


Moving files is a common task and it’s quite boring. If you have a lot of subfolders, it would be a waste of time to move them manually, so I suggest you take a look at this command

Copying Files Using The Tokens / Delims Command

1. Open the command prompt

2. Enter the drive letter you want to go to e.g. C:

3. Enter cd C:\myfolder\path\this path needs to be the root directory with all the subdirectories!

4. Now simply enter this command

for /f "tokens=*" %a in ('dir /b /s /a-d') do @copy "%a" "C:\newpath\" /y

Moving Files From Subdirectories

REPLACE C:\newpath\ with your own path

5. Done! You moved all files from subfolders in C:\myfolder\path\ to C:\newpath\

As you can see, it’s really easy to move files with the command prompt using the tokens command.

If you want to find out more about how this work, I suggest you enter dir /? for a list of the command line switches that are used in this example.

Rate this article:
This article was rated 5 out of 5 stars
Based on 1 ratings

How to keep windows always on top
Add Shutdown and Restart Tiles To Your Windows 8 Start Screen
Productivity: Change Keyboard Repeat Delay, Repeat Rate and Blink Rate

Juicy Logo White You love Windows, Gaming and everything digital? Great, we too! We have thousands of great Windows 7 themes, registry tweaks, tutorials, so please use our search box if you look for anything specific.

If you have some awesome desktop themes, tips or want to write for us, then drop us a mail!



Written by: Oliver Krautscheid
Oliver is the founder and lead editor of this site. He is interested in finding new ways to break Windows, find common e.... Full Bio

Contact The Author: Get Free Help.png

Connect:

facebook google twitter LinkedIn


Need help? Ask a question at our QA site, click the red button to get started:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>