Solved

powershell command to copy and paste files

Posted on 2015-01-04
4
400 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 69

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 40

Accepted Solution

by:
footech earned 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 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