Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

powershell command to copy and paste files

Posted on 2015-01-04
4
Medium Priority
?
502 Views
Last Modified: 2015-01-04
I have a folder with multiple folders and sub-folders in those folders.
there are mp3 files in all of the folders underneath my main folder called music.

can i get cmd syntax for powershell to copy all mp3 files under the folder music and its subfolders and then paste it in a folder called music1 under c drive
0
Comment
Question by:jamesmetcalf74
  • 2
4 Comments
 
LVL 71

Expert Comment

by:Qlemo
ID: 40530629
Do you want to have the same folder structure in the destination, or have all files in a single folder?
0
 

Author Comment

by:jamesmetcalf74
ID: 40530853
single folder
0
 
LVL 41

Accepted Solution

by:
footech earned 2000 total points
ID: 40530897
The following should do what you want.  You can change the paths as appropriate.
Get-ChildItem -Path c:\music -filter *.mp3 -recurse | Copy-Item -Destination c:\music1

Open in new window

0
 

Author Closing Comment

by:jamesmetcalf74
ID: 40530907
that did the trick
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question