Solved

powershell command to copy and paste files

Posted on 2015-01-04
4
395 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 39

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

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 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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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